MODULE OUTPUT_DATA

! Output quantity arrays

USE PRECISION_PARAMETERS
USE GLOBAL_CONSTANTS, ONLY: CELL_CENTER

IMPLICIT NONE (TYPE,EXTERNAL)

INTEGER, PARAMETER :: N_Q_DOT=9
INTEGER :: PLOT3D_QUANTITY_INDEX(5),PLOT3D_Y_INDEX(5)=0,PLOT3D_Z_INDEX(5)=0,PLOT3D_PART_INDEX(5),&
           PLOT3D_VELO_INDEX(5)=0
CHARACTER(LABEL_LENGTH) :: PLOT3D_QUANTITY(5),PLOT3D_SPEC_ID(5),PLOT3D_PART_ID(5),PLOT3D_SMOKEVIEW_BAR_LABEL(5)
CHARACTER(LABEL_LENGTH) :: PLOT3D_SMOKEVIEW_LABEL(5)
INTEGER :: N_BNDF,N_ISOF,N_PROF,N_SLCF_MAX=0,N_SMOKE3D=0
INTEGER :: HVAC_SMV_EQUIVALENCE(300:350)
REAL(EB) :: T_LAST_DUMP_HRR,T_LAST_DUMP_MASS,T_LAST_DUMP_MOM
REAL(EB),ALLOCATABLE, DIMENSION(:) :: ENTHALPY_SUM
REAL(EB),ALLOCATABLE, DIMENSION(:) :: MASS_DT,Q_DOT,Q_DOT_SUM,M_DOT,M_DOT_SUM

TYPE SMOKE3D_TYPE
   INTEGER :: QUANTITY_INDEX,Y_INDEX=0,Z_INDEX=0
   REAL(EB) :: MASS_EXTINCTION_COEFFICIENT
   CHARACTER(LABEL_LENGTH) :: QUANTITY,SPEC_ID,SMOKEVIEW_BAR_LABEL,SMOKEVIEW_LABEL,UNITS,DISPLAY_TYPE
END TYPE SMOKE3D_TYPE

TYPE (SMOKE3D_TYPE), DIMENSION(:), ALLOCATABLE, TARGET :: SMOKE3D_FILE

TYPE OUTPUT_QUANTITY_TYPE
   CHARACTER(LABEL_LENGTH) :: NAME='null',OLD_NAME='null',SHORT_NAME='null',UNITS='null'
   REAL(EB) :: AMBIENT_VALUE=0._EB
   INTEGER :: IOR=0,CELL_POSITION=CELL_CENTER
   LOGICAL :: SLCF_APPROPRIATE=.TRUE.,BNDF_APPROPRIATE=.FALSE.,ISOF_APPROPRIATE=.TRUE.,PART_APPROPRIATE=.FALSE.,&
              INTEGRATED=.FALSE.,SOLID_PHASE=.FALSE.,GAS_PHASE=.TRUE.,INTEGRATED_PARTICLES=.FALSE.,&
              MASS_FRACTION=.FALSE.,SPEC_ID_REQUIRED=.FALSE.,PART_ID_REQUIRED=.FALSE.,INSIDE_SOLID=.FALSE.,&
              MATL_ID_REQUIRED=.FALSE.,TIME_AVERAGED=.TRUE.,DEVC_APPROPRIATE=.TRUE.,&
              DUCT_ID_REQUIRED=.FALSE.,NODE_ID_REQUIRED=.FALSE.,HVAC=.FALSE.,QUANTITY2_REQUIRED=.FALSE.,&
              CELL_L_REQUIRED=.FALSE.,HVAC_SMV=.FALSE.,PROF_APPROPRIATE=.FALSE., ELEM_ID_REQUIRED=.FALSE.
END TYPE OUTPUT_QUANTITY_TYPE

TYPE (OUTPUT_QUANTITY_TYPE), DIMENSION(:), ALLOCATABLE, TARGET :: OUTPUT_QUANTITY

CONTAINS


SUBROUTINE DEFINE_OUTPUT_QUANTITIES

! Define all OUTPUT_QUANTITYs and their attributes

USE GLOBAL_CONSTANTS, ONLY: CELL_FACE,CELL_EDGE
USE MEMORY_FUNCTIONS, ONLY:ChkMemErr

INTEGER :: N,IZERO

ALLOCATE(OUTPUT_QUANTITY(-N_OUTPUT_QUANTITIES:N_OUTPUT_QUANTITIES),STAT=IZERO)
CALL ChkMemErr('READ','OUTPUT_QUANTITY',IZERO)

DO N=-N_OUTPUT_QUANTITIES,N_OUTPUT_QUANTITIES
   IF (N < 0) THEN
      OUTPUT_QUANTITY(N)%SOLID_PHASE = .TRUE.
      OUTPUT_QUANTITY(N)%ISOF_APPROPRIATE = .FALSE.
      OUTPUT_QUANTITY(N)%SLCF_APPROPRIATE = .FALSE.
      OUTPUT_QUANTITY(N)%BNDF_APPROPRIATE = .TRUE.
      OUTPUT_QUANTITY(N)%PART_APPROPRIATE = .TRUE.
   ENDIF
ENDDO

OUTPUT_QUANTITY(0)%NAME        = 'SMOKE/WATER'
OUTPUT_QUANTITY(0)%UNITS       = '  '
OUTPUT_QUANTITY(0)%SHORT_NAME  = '  '

OUTPUT_QUANTITY(1)%NAME  = 'DENSITY'
OUTPUT_QUANTITY(1)%UNITS  = 'kg/m3'
OUTPUT_QUANTITY(1)%SHORT_NAME  = 'rho'

OUTPUT_QUANTITY(2)%NAME  = 'F_X'
OUTPUT_QUANTITY(2)%UNITS  = 'm/s2'
OUTPUT_QUANTITY(2)%SHORT_NAME  = 'f_x'
OUTPUT_QUANTITY(2)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(2)%IOR = 1

OUTPUT_QUANTITY(3)%NAME  = 'F_Y'
OUTPUT_QUANTITY(3)%UNITS  = 'm/s2'
OUTPUT_QUANTITY(3)%SHORT_NAME  = 'f_y'
OUTPUT_QUANTITY(3)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(3)%IOR = 2

OUTPUT_QUANTITY(4)%NAME  = 'F_Z'
OUTPUT_QUANTITY(4)%UNITS  = 'm/s2'
OUTPUT_QUANTITY(4)%SHORT_NAME  = 'f_z'
OUTPUT_QUANTITY(4)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(4)%IOR = 3

OUTPUT_QUANTITY(5)%NAME  = 'TEMPERATURE'
OUTPUT_QUANTITY(5)%UNITS  = 'C'
OUTPUT_QUANTITY(5)%SHORT_NAME  = 'temp'

OUTPUT_QUANTITY(6)%NAME  = 'U-VELOCITY'
OUTPUT_QUANTITY(6)%UNITS  = 'm/s'
OUTPUT_QUANTITY(6)%SHORT_NAME  = 'U-VEL'
OUTPUT_QUANTITY(6)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(6)%IOR = 1

OUTPUT_QUANTITY(7)%NAME  = 'V-VELOCITY'
OUTPUT_QUANTITY(7)%UNITS = 'm/s'
OUTPUT_QUANTITY(7)%SHORT_NAME  = 'V-VEL'
OUTPUT_QUANTITY(7)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(7)%IOR = 2

OUTPUT_QUANTITY(8)%NAME  = 'W-VELOCITY'
OUTPUT_QUANTITY(8)%UNITS  = 'm/s'
OUTPUT_QUANTITY(8)%SHORT_NAME  = 'W-VEL'
OUTPUT_QUANTITY(8)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(8)%IOR = 3

OUTPUT_QUANTITY(6:8)%PART_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(9)%NAME  = 'PRESSURE'
OUTPUT_QUANTITY(9)%UNITS  = 'Pa'
OUTPUT_QUANTITY(9)%SHORT_NAME  = 'pres'

OUTPUT_QUANTITY(10)%NAME = 'VELOCITY'
OUTPUT_QUANTITY(10)%UNITS = 'm/s'
OUTPUT_QUANTITY(10)%SHORT_NAME = 'vel'

OUTPUT_QUANTITY(11)%NAME = 'HRRPUV'
OUTPUT_QUANTITY(11)%UNITS = 'kW/m3'
OUTPUT_QUANTITY(11)%SHORT_NAME = 'hrrpuv'

OUTPUT_QUANTITY(12)%NAME = 'H'
OUTPUT_QUANTITY(12)%UNITS = '(m/s)^2'
OUTPUT_QUANTITY(12)%SHORT_NAME = 'head'

OUTPUT_QUANTITY(13)%NAME = 'MIXTURE FRACTION'
OUTPUT_QUANTITY(13)%UNITS = 'kg/kg'
OUTPUT_QUANTITY(13)%SHORT_NAME = 'Z'

OUTPUT_QUANTITY(14)%NAME = 'DIVERGENCE'
OUTPUT_QUANTITY(14)%UNITS = '1/s'
OUTPUT_QUANTITY(14)%SHORT_NAME = 'div'

OUTPUT_QUANTITY(15)%NAME = 'MIXING TIME'
OUTPUT_QUANTITY(15)%UNITS = 's'
OUTPUT_QUANTITY(15)%SHORT_NAME = 'mix'

OUTPUT_QUANTITY(16)%NAME = 'ABSORPTION COEFFICIENT'
OUTPUT_QUANTITY(16)%UNITS = '1/m'
OUTPUT_QUANTITY(16)%SHORT_NAME = 'kappa'

OUTPUT_QUANTITY(17)%NAME = 'VISCOSITY'
OUTPUT_QUANTITY(17)%UNITS = 'kg/m/s'
OUTPUT_QUANTITY(17)%SHORT_NAME = 'mu eff'

OUTPUT_QUANTITY(18)%NAME = 'INTEGRATED INTENSITY'
OUTPUT_QUANTITY(18)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(18)%SHORT_NAME = 'U'

OUTPUT_QUANTITY(19)%NAME = 'RADIATION LOSS'
OUTPUT_QUANTITY(19)%UNITS = 'kW/m3'
OUTPUT_QUANTITY(19)%SHORT_NAME = 'loss'

OUTPUT_QUANTITY(20)%NAME = 'PARTICLE RADIATION LOSS'
OUTPUT_QUANTITY(20)%UNITS = 'kW/m3'
OUTPUT_QUANTITY(20)%SHORT_NAME = 'part_rad'

OUTPUT_QUANTITY(21)%NAME = 'RELATIVE HUMIDITY'
OUTPUT_QUANTITY(21)%UNITS = '%'
OUTPUT_QUANTITY(21)%SHORT_NAME = 'humid'

OUTPUT_QUANTITY(22)%NAME = 'HS'
OUTPUT_QUANTITY(22)%UNITS = 'm2/s2'
OUTPUT_QUANTITY(22)%SHORT_NAME = 'hs'

OUTPUT_QUANTITY(23)%NAME = 'KINETIC ENERGY'
OUTPUT_QUANTITY(23)%UNITS = 'm2/s2'
OUTPUT_QUANTITY(23)%SHORT_NAME = 'ke'

! Strain and Vorticity

OUTPUT_QUANTITY(24)%NAME = 'STRAIN RATE X'
OUTPUT_QUANTITY(24)%UNITS = '1/s'
OUTPUT_QUANTITY(24)%SHORT_NAME = 'strain_x'
OUTPUT_QUANTITY(24)%IOR = 1

OUTPUT_QUANTITY(25)%NAME = 'STRAIN RATE Y'
OUTPUT_QUANTITY(25)%UNITS = '1/s'
OUTPUT_QUANTITY(25)%SHORT_NAME = 'strain_y'
OUTPUT_QUANTITY(25)%IOR = 2

OUTPUT_QUANTITY(26)%NAME = 'STRAIN RATE Z'
OUTPUT_QUANTITY(26)%UNITS = '1/s'
OUTPUT_QUANTITY(26)%SHORT_NAME = 'strain_z'
OUTPUT_QUANTITY(26)%IOR = 3

OUTPUT_QUANTITY(27)%NAME = 'VORTICITY X'
OUTPUT_QUANTITY(27)%UNITS = '1/s'
OUTPUT_QUANTITY(27)%SHORT_NAME = 'vort_x'
OUTPUT_QUANTITY(27)%IOR = 1

OUTPUT_QUANTITY(28)%NAME = 'VORTICITY Y'
OUTPUT_QUANTITY(28)%UNITS = '1/s'
OUTPUT_QUANTITY(28)%SHORT_NAME = 'vort_y'
OUTPUT_QUANTITY(28)%IOR = 2

OUTPUT_QUANTITY(29)%NAME = 'VORTICITY Z'
OUTPUT_QUANTITY(29)%UNITS = '1/s'
OUTPUT_QUANTITY(29)%SHORT_NAME = 'vort_z'
OUTPUT_QUANTITY(29)%IOR = 3

OUTPUT_QUANTITY(24:29)%CELL_POSITION = CELL_EDGE

OUTPUT_QUANTITY(30)%NAME = 'C_SMAG'
OUTPUT_QUANTITY(30)%UNITS = '  '
OUTPUT_QUANTITY(30)%SHORT_NAME = 'c_smag'

OUTPUT_QUANTITY(31)%NAME = 'SPECIFIC HEAT'
OUTPUT_QUANTITY(31)%UNITS = 'kJ/kg/K'
OUTPUT_QUANTITY(31)%SHORT_NAME = 'c_p'

OUTPUT_QUANTITY(32)%NAME = 'ORIENTED VELOCITY'
OUTPUT_QUANTITY(32)%UNITS = 'm/s'
OUTPUT_QUANTITY(32)%SHORT_NAME = 'vel'
OUTPUT_QUANTITY(32)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(32)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(32)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(33)%NAME = 'CONDUCTIVITY'
OUTPUT_QUANTITY(33)%UNITS = 'W/m/K'
OUTPUT_QUANTITY(33)%SHORT_NAME = 'k'

OUTPUT_QUANTITY(34)%NAME = 'BACKGROUND PRESSURE'
OUTPUT_QUANTITY(34)%UNITS = 'Pa'
OUTPUT_QUANTITY(34)%SHORT_NAME = 'pbar'

OUTPUT_QUANTITY(35)%NAME = 'MOLECULAR WEIGHT'
OUTPUT_QUANTITY(35)%UNITS = 'g/mol'
OUTPUT_QUANTITY(35)%SHORT_NAME = 'MW'

OUTPUT_QUANTITY(36)%NAME = 'POTENTIAL TEMPERATURE'
OUTPUT_QUANTITY(36)%UNITS = 'K'
OUTPUT_QUANTITY(36)%SHORT_NAME = 'theta'

OUTPUT_QUANTITY(37)%NAME = 'DIFFUSIVITY'
OUTPUT_QUANTITY(37)%UNITS = 'm^2/s'
OUTPUT_QUANTITY(37)%SHORT_NAME = 'D'

! Time and benchmarking stats

OUTPUT_QUANTITY(38)%NAME = 'RTE SOURCE CORRECTION FACTOR'
OUTPUT_QUANTITY(38)%UNITS = ' '
OUTPUT_QUANTITY(38)%SHORT_NAME = 'C'

OUTPUT_QUANTITY(39)%NAME = 'RAM'  ! This is a non-standard output. To make it work, you must uncomment GETPID in func.f90.
OUTPUT_QUANTITY(39)%UNITS = 'MB'
OUTPUT_QUANTITY(39)%SHORT_NAME = 'RAM'

OUTPUT_QUANTITY(40)%NAME = 'TIME'
OUTPUT_QUANTITY(40)%UNITS = 's'
OUTPUT_QUANTITY(40)%SHORT_NAME = 't'

OUTPUT_QUANTITY(41)%NAME = 'TIME STEP'
OUTPUT_QUANTITY(41)%UNITS = 's'
OUTPUT_QUANTITY(41)%SHORT_NAME = 'dt'

OUTPUT_QUANTITY(42)%NAME = 'WALL CLOCK TIME'
OUTPUT_QUANTITY(42)%UNITS = 's'
OUTPUT_QUANTITY(42)%SHORT_NAME = 't_wall'

OUTPUT_QUANTITY(43)%NAME = 'WALL CLOCK TIME ITERATIONS'
OUTPUT_QUANTITY(43)%UNITS = 's'
OUTPUT_QUANTITY(43)%SHORT_NAME = 't_wall_it'

OUTPUT_QUANTITY(44)%NAME = 'CPU TIME'
OUTPUT_QUANTITY(44)%UNITS = 's'
OUTPUT_QUANTITY(44)%SHORT_NAME = 't_cpu'

OUTPUT_QUANTITY(45)%NAME = 'ITERATION'
OUTPUT_QUANTITY(45)%UNITS = ' '
OUTPUT_QUANTITY(45)%SHORT_NAME = 'step'

OUTPUT_QUANTITY(38:45)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(38:45)%ISOF_APPROPRIATE = .FALSE.

! Enthalpy

OUTPUT_QUANTITY(46)%NAME = 'SPECIFIC ENTHALPY'
OUTPUT_QUANTITY(46)%UNITS = 'kJ/kg'
OUTPUT_QUANTITY(46)%SHORT_NAME = 'h'

OUTPUT_QUANTITY(47)%NAME = 'ENTHALPY'
OUTPUT_QUANTITY(47)%UNITS = 'kJ/m3'
OUTPUT_QUANTITY(47)%SHORT_NAME = 'H'

OUTPUT_QUANTITY(48)%NAME = 'SPECIFIC SENSIBLE ENTHALPY'
OUTPUT_QUANTITY(48)%UNITS = 'kJ/kg'
OUTPUT_QUANTITY(48)%SHORT_NAME = 'h_s'

OUTPUT_QUANTITY(49)%NAME = 'SENSIBLE ENTHALPY'
OUTPUT_QUANTITY(49)%UNITS = 'kJ/m3'
OUTPUT_QUANTITY(49)%SHORT_NAME = 'H_s'

OUTPUT_QUANTITY(50)%NAME = 'MOLECULAR CONDUCTIVITY'
OUTPUT_QUANTITY(50)%UNITS = 'W/m/K'
OUTPUT_QUANTITY(50)%SHORT_NAME = 'k'

OUTPUT_QUANTITY(51)%NAME  = 'RESOLVED KINETIC ENERGY'
OUTPUT_QUANTITY(51)%UNITS  = 'm2/s2'
OUTPUT_QUANTITY(51)%SHORT_NAME  = 'k_res'

OUTPUT_QUANTITY(52)%NAME = 'WAVELET ERROR'
OUTPUT_QUANTITY(52)%UNITS = '  '
OUTPUT_QUANTITY(52)%SHORT_NAME = 'wem'
OUTPUT_QUANTITY(52)%QUANTITY2_REQUIRED = .TRUE.
OUTPUT_QUANTITY(52)%SLCF_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(52)%ISOF_APPROPRIATE = .FALSE.

! Cell-centered velocity components

OUTPUT_QUANTITY(53)%NAME  = 'CELL U'
OUTPUT_QUANTITY(53)%UNITS  = 'm/s'
OUTPUT_QUANTITY(53)%SHORT_NAME  = 'u_p'

OUTPUT_QUANTITY(54)%NAME  = 'CELL V'
OUTPUT_QUANTITY(54)%UNITS  = 'm/s'
OUTPUT_QUANTITY(54)%SHORT_NAME  = 'v_p'

OUTPUT_QUANTITY(55)%NAME  = 'CELL W'
OUTPUT_QUANTITY(55)%UNITS  = 'm/s'
OUTPUT_QUANTITY(55)%SHORT_NAME  = 'w_p'

OUTPUT_QUANTITY(56)%NAME  = 'SUBGRID KINETIC ENERGY'
OUTPUT_QUANTITY(56)%UNITS  = 'm2/s2'
OUTPUT_QUANTITY(56)%SHORT_NAME  = 'k_sgs'

! Pressure iteration info

OUTPUT_QUANTITY(57)%NAME = 'MAXIMUM VELOCITY ERROR'
OUTPUT_QUANTITY(57)%UNITS = 'm/s'
OUTPUT_QUANTITY(57)%SHORT_NAME = 'vel err'
OUTPUT_QUANTITY(57)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(57)%ISOF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(58)%NAME = 'PRESSURE ITERATIONS'
OUTPUT_QUANTITY(58)%UNITS = ' '
OUTPUT_QUANTITY(58)%SHORT_NAME = 'its'
OUTPUT_QUANTITY(58)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(58)%ISOF_APPROPRIATE = .FALSE.

! Miscellaneous outputs

OUTPUT_QUANTITY(59)%NAME = 'OPEN NOZZLES'
OUTPUT_QUANTITY(59)%UNITS = ' '
OUTPUT_QUANTITY(59)%SHORT_NAME = 'open'
OUTPUT_QUANTITY(59)%TIME_AVERAGED = .FALSE.

OUTPUT_QUANTITY(60)%NAME = 'ACTUATED SPRINKLERS'
OUTPUT_QUANTITY(60)%UNITS = ' '
OUTPUT_QUANTITY(60)%SHORT_NAME = 'act'
OUTPUT_QUANTITY(60)%TIME_AVERAGED = .FALSE.

! Drag from particles

OUTPUT_QUANTITY(61)%NAME = 'DRAG FORCE X'
OUTPUT_QUANTITY(61)%UNITS = 'N/m3'
OUTPUT_QUANTITY(61)%SHORT_NAME = 'drag_x'
OUTPUT_QUANTITY(61)%IOR = 1

OUTPUT_QUANTITY(62)%NAME = 'DRAG FORCE Y'
OUTPUT_QUANTITY(62)%UNITS = 'N/m3'
OUTPUT_QUANTITY(62)%SHORT_NAME = 'drag_y'
OUTPUT_QUANTITY(62)%IOR = 2

OUTPUT_QUANTITY(63)%NAME = 'DRAG FORCE Z'
OUTPUT_QUANTITY(63)%UNITS = 'N/m3'
OUTPUT_QUANTITY(63)%SHORT_NAME = 'drag_z'
OUTPUT_QUANTITY(63)%IOR = 3

OUTPUT_QUANTITY(64)%NAME  = 'EFFECTIVE FLAME TEMPERATURE'
OUTPUT_QUANTITY(64)%UNITS  = 'C'
OUTPUT_QUANTITY(64)%SHORT_NAME  = 'temp'

OUTPUT_QUANTITY(68)%NAME = 'SPECIFIC INTERNAL ENERGY'
OUTPUT_QUANTITY(68)%UNITS = 'kJ/kg'
OUTPUT_QUANTITY(68)%SHORT_NAME = 'u'

OUTPUT_QUANTITY(69)%NAME = 'INTERNAL ENERGY'
OUTPUT_QUANTITY(69)%UNITS = 'kJ/m3'
OUTPUT_QUANTITY(69)%SHORT_NAME = 'U'

! Numerical stability parameters

OUTPUT_QUANTITY(70)%NAME = 'CFL'
OUTPUT_QUANTITY(70)%UNITS = ' '
OUTPUT_QUANTITY(70)%SHORT_NAME = 'CFL'

OUTPUT_QUANTITY(71)%NAME = 'VN'
OUTPUT_QUANTITY(71)%UNITS = ' '
OUTPUT_QUANTITY(71)%SHORT_NAME = 'VN'

OUTPUT_QUANTITY(72)%NAME = 'CFL MAX'
OUTPUT_QUANTITY(72)%UNITS = ' '
OUTPUT_QUANTITY(72)%SHORT_NAME = 'CFL'
OUTPUT_QUANTITY(72)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(72)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(72)%PART_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(73)%NAME = 'VN MAX'
OUTPUT_QUANTITY(73)%UNITS = ' '
OUTPUT_QUANTITY(73)%SHORT_NAME = 'VN'
OUTPUT_QUANTITY(73)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(73)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(73)%PART_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(74)%NAME = 'POISSON ERROR'
OUTPUT_QUANTITY(74)%UNITS = '1/s'
OUTPUT_QUANTITY(74)%SHORT_NAME = 'pois_err'
OUTPUT_QUANTITY(74)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(74)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(74)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(74)%TIME_AVERAGED    = .FALSE.

OUTPUT_QUANTITY(75)%NAME = 'DIVERGENCE ERROR'
OUTPUT_QUANTITY(75)%UNITS = '1/s'
OUTPUT_QUANTITY(75)%SHORT_NAME = 'div_err'
OUTPUT_QUANTITY(75)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(75)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(75)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(75)%TIME_AVERAGED    = .FALSE.

! Radial velocity pointing towards the vertical z axis (cylindrical coordinates)

OUTPUT_QUANTITY(76)%NAME  = 'RADIAL VELOCITY'
OUTPUT_QUANTITY(76)%UNITS  = 'm/s'
OUTPUT_QUANTITY(76)%SHORT_NAME  = 'U_R'

! Level Set

OUTPUT_QUANTITY(77)%NAME = 'LEVEL SET VALUE'
OUTPUT_QUANTITY(77)%UNITS = ' '
OUTPUT_QUANTITY(77)%SHORT_NAME = 'phi'

! Special radiation terms

OUTPUT_QUANTITY(78)%NAME = 'RADIATION EMISSION'
OUTPUT_QUANTITY(78)%UNITS = 'kW/m3'
OUTPUT_QUANTITY(78)%SHORT_NAME = 'emit'

OUTPUT_QUANTITY(79)%NAME = 'RADIATION ABSORPTION'
OUTPUT_QUANTITY(79)%UNITS = 'kW/m3'
OUTPUT_QUANTITY(79)%SHORT_NAME = 'abs'

! Cell indices (for Smokeview debugging)

OUTPUT_QUANTITY(80)%NAME = 'CELL INDEX I'
OUTPUT_QUANTITY(80)%UNITS = ' '
OUTPUT_QUANTITY(80)%SHORT_NAME = 'i'

OUTPUT_QUANTITY(81)%NAME = 'CELL INDEX J'
OUTPUT_QUANTITY(81)%UNITS = ' '
OUTPUT_QUANTITY(81)%SHORT_NAME = 'j'

OUTPUT_QUANTITY(82)%NAME = 'CELL INDEX K'
OUTPUT_QUANTITY(82)%UNITS = ' '
OUTPUT_QUANTITY(82)%SHORT_NAME = 'k'

! Kolmogorov length scale

OUTPUT_QUANTITY(83)%NAME = 'Q CRITERION'
OUTPUT_QUANTITY(83)%UNITS = '1/s2'
OUTPUT_QUANTITY(83)%SHORT_NAME = 'Qcr'

OUTPUT_QUANTITY(84)%NAME = 'STRAIN RATE'
OUTPUT_QUANTITY(84)%UNITS = '1/s'
OUTPUT_QUANTITY(84)%SHORT_NAME = '|S|'

OUTPUT_QUANTITY(85)%NAME = 'KOLMOGOROV LENGTH SCALE'
OUTPUT_QUANTITY(85)%UNITS = 'm'
OUTPUT_QUANTITY(85)%SHORT_NAME = 'eta'

OUTPUT_QUANTITY(86)%NAME = 'CELL REYNOLDS NUMBER'
OUTPUT_QUANTITY(86)%UNITS = ' '
OUTPUT_QUANTITY(86)%SHORT_NAME = 'dx/eta'

OUTPUT_QUANTITY(87)%NAME = 'MOLECULAR VISCOSITY'
OUTPUT_QUANTITY(87)%UNITS = 'kg/m/s'
OUTPUT_QUANTITY(87)%SHORT_NAME = 'mu dns'

OUTPUT_QUANTITY(88)%NAME = 'DISSIPATION RATE'
OUTPUT_QUANTITY(88)%UNITS = 'm2/s3'
OUTPUT_QUANTITY(88)%SHORT_NAME = 'epsilon'

OUTPUT_QUANTITY(89)%NAME = 'KINEMATIC VISCOSITY'
OUTPUT_QUANTITY(89)%UNITS = 'm2/s'
OUTPUT_QUANTITY(89)%SHORT_NAME = 'nu eff'

! Species-specific quantities that require a SPEC_ID

OUTPUT_QUANTITY(90)%NAME='MASS FRACTION'
OUTPUT_QUANTITY(90)%UNITS='kg/kg'
OUTPUT_QUANTITY(90)%MASS_FRACTION = .TRUE.
OUTPUT_QUANTITY(90)%SHORT_NAME = 'Y'
OUTPUT_QUANTITY(90)%SPEC_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(91)%NAME = 'MASS FLUX X'
OUTPUT_QUANTITY(91)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(91)%SHORT_NAME = 'u*rho*Y'
OUTPUT_QUANTITY(91)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(91)%IOR = 1

OUTPUT_QUANTITY(92)%NAME = 'MASS FLUX Y'
OUTPUT_QUANTITY(92)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(92)%SHORT_NAME = 'v*rho*Y'
OUTPUT_QUANTITY(92)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(92)%IOR = 2

OUTPUT_QUANTITY(93)%NAME = 'MASS FLUX Z'
OUTPUT_QUANTITY(93)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(93)%SHORT_NAME = 'w*rho*Y'
OUTPUT_QUANTITY(93)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(93)%IOR = 3

OUTPUT_QUANTITY(94)%NAME = 'VOLUME FRACTION'
OUTPUT_QUANTITY(94)%UNITS = 'mol/mol'
OUTPUT_QUANTITY(94)%SHORT_NAME = 'X'

OUTPUT_QUANTITY(95)%NAME = 'VISIBILITY'
OUTPUT_QUANTITY(95)%UNITS = 'm'
OUTPUT_QUANTITY(95)%SHORT_NAME = 'VIS'

OUTPUT_QUANTITY(96)%NAME = 'AEROSOL VOLUME FRACTION'
OUTPUT_QUANTITY(96)%UNITS = ' '
OUTPUT_QUANTITY(96)%SHORT_NAME = 'f_v'

OUTPUT_QUANTITY(97)%NAME = 'EXTINCTION COEFFICIENT'
OUTPUT_QUANTITY(97)%UNITS = '1/m'
OUTPUT_QUANTITY(97)%SHORT_NAME = 'ext_coef'

OUTPUT_QUANTITY(98)%NAME = 'OPTICAL DENSITY'
OUTPUT_QUANTITY(98)%UNITS = '1/m'
OUTPUT_QUANTITY(98)%SHORT_NAME = 'OD'

OUTPUT_QUANTITY(94:98)%SPEC_ID_REQUIRED = .TRUE.

! Miscellaneous

OUTPUT_QUANTITY(99)%NAME  = 'PRESSURE POISSON RESIDUAL'
OUTPUT_QUANTITY(99)%UNITS  = '1/s2'
OUTPUT_QUANTITY(99)%SHORT_NAME  = 'pp_res'

OUTPUT_QUANTITY(100)%NAME  = 'PRESSURE ZONE'
OUTPUT_QUANTITY(100)%UNITS  = ' '
OUTPUT_QUANTITY(100)%SHORT_NAME  = 'zone'

! Fractional Incapacitating Concentration (FIC)

OUTPUT_QUANTITY(101)%NAME  = 'FIC'
OUTPUT_QUANTITY(101)%UNITS = ''
OUTPUT_QUANTITY(101)%SHORT_NAME  = 'fic'
OUTPUT_QUANTITY(101)%SLCF_APPROPRIATE = .TRUE.

! Cell solid mass per unit volume

OUTPUT_QUANTITY(102)%NAME = 'BULK DENSITY'
OUTPUT_QUANTITY(102)%UNITS = 'kg/m3'
OUTPUT_QUANTITY(102)%SHORT_NAME = 'mpuv'

! Integrated Quantities

OUTPUT_QUANTITY(105)%NAME  = 'LAYER HEIGHT'
OUTPUT_QUANTITY(105)%UNITS  = 'm'
OUTPUT_QUANTITY(105)%SHORT_NAME  = 'layer'

OUTPUT_QUANTITY(106)%NAME  = 'UPPER TEMPERATURE'
OUTPUT_QUANTITY(106)%UNITS  = 'C'
OUTPUT_QUANTITY(106)%SHORT_NAME  = 'u-tmp'

OUTPUT_QUANTITY(107)%NAME  = 'LOWER TEMPERATURE'
OUTPUT_QUANTITY(107)%UNITS  = 'C'
OUTPUT_QUANTITY(107)%SHORT_NAME  = 'l-tmp'

OUTPUT_QUANTITY(105:107)%INTEGRATED = .TRUE.
OUTPUT_QUANTITY(105:107)%SLCF_APPROPRIATE = .FALSE.

! Fractional Effective Dose (FED)

OUTPUT_QUANTITY(109)%NAME  = 'FED'
OUTPUT_QUANTITY(109)%UNITS = ''
OUTPUT_QUANTITY(109)%SHORT_NAME  = 'fed'
OUTPUT_QUANTITY(109)%SLCF_APPROPRIATE = .FALSE.

! Model of a TC

OUTPUT_QUANTITY(110)%NAME  = 'THERMOCOUPLE'
OUTPUT_QUANTITY(110)%UNITS = 'C'
OUTPUT_QUANTITY(110)%SHORT_NAME  = 'tc'

! Mass and Energy Flows

OUTPUT_QUANTITY(111)%NAME  = 'ENTHALPY FLUX X'
OUTPUT_QUANTITY(111)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(111)%SHORT_NAME  = 'hflux'

OUTPUT_QUANTITY(112)%NAME  = 'ENTHALPY FLUX Y'
OUTPUT_QUANTITY(112)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(112)%SHORT_NAME  = 'hflux'

OUTPUT_QUANTITY(113)%NAME  = 'ENTHALPY FLUX Z'
OUTPUT_QUANTITY(113)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(113)%SHORT_NAME  = 'hflux'

! Special Outputs for Partially Stirred Batch Reactor Model

OUTPUT_QUANTITY(130)%NAME  = 'EXTINCTION'
OUTPUT_QUANTITY(130)%UNITS  = ''
OUTPUT_QUANTITY(130)%SHORT_NAME  = 'extinct'

OUTPUT_QUANTITY(131)%NAME  = 'CHEMISTRY SUBITERATIONS'
OUTPUT_QUANTITY(131)%UNITS  = ''
OUTPUT_QUANTITY(131)%SHORT_NAME  = 'chem it'

OUTPUT_QUANTITY(132)%NAME  = 'REAC SOURCE TERM'
OUTPUT_QUANTITY(132)%UNITS  = 'kg/m3/s'
OUTPUT_QUANTITY(132)%SHORT_NAME  = 'reac source'
OUTPUT_QUANTITY(132)%SPEC_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(133)%NAME  = 'SUM LUMPED MASS FRACTIONS'
OUTPUT_QUANTITY(133)%UNITS  = ''
OUTPUT_QUANTITY(133)%SHORT_NAME  = 'sum Z'

OUTPUT_QUANTITY(134)%NAME  = 'SUM PRIMITIVE MASS FRACTIONS'
OUTPUT_QUANTITY(134)%UNITS  = ''
OUTPUT_QUANTITY(134)%SHORT_NAME  = 'sum Y'

OUTPUT_QUANTITY(135)%NAME  = 'MACH NUMBER'
OUTPUT_QUANTITY(135)%UNITS  = ''
OUTPUT_QUANTITY(135)%SHORT_NAME  = 'c'

OUTPUT_QUANTITY(136)%NAME  = 'UNMIXED FRACTION'
OUTPUT_QUANTITY(136)%UNITS  = ''
OUTPUT_QUANTITY(136)%SHORT_NAME  = 'zeta'

OUTPUT_QUANTITY(138)%NAME  = 'HRRPUV REAC'
OUTPUT_QUANTITY(138)%UNITS  = 'kW/m3'
OUTPUT_QUANTITY(138)%SHORT_NAME  = 'hrrpuv'

OUTPUT_QUANTITY(140)%NAME  = 'FVX_B'
OUTPUT_QUANTITY(140)%UNITS  = 'm/s2'
OUTPUT_QUANTITY(140)%SHORT_NAME  = 'fvx_b'
OUTPUT_QUANTITY(140)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(140)%IOR = 1

OUTPUT_QUANTITY(141)%NAME  = 'FVY_B'
OUTPUT_QUANTITY(141)%UNITS  = 'm/s2'
OUTPUT_QUANTITY(141)%SHORT_NAME  = 'fvy_b'
OUTPUT_QUANTITY(141)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(141)%IOR = 2

OUTPUT_QUANTITY(142)%NAME  = 'FVZ_B'
OUTPUT_QUANTITY(142)%UNITS  = 'm/s2'
OUTPUT_QUANTITY(142)%SHORT_NAME  = 'fvz_b'
OUTPUT_QUANTITY(142)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(142)%IOR = 3

OUTPUT_QUANTITY(143)%NAME  = 'COMBUSTION EFFICIENCY'
OUTPUT_QUANTITY(143)%UNITS  = ''
OUTPUT_QUANTITY(143)%SHORT_NAME  = 'eta'

OUTPUT_QUANTITY(144)%NAME='ELEMENT MASS FRACTION'
OUTPUT_QUANTITY(144)%UNITS='kg/kg'
OUTPUT_QUANTITY(144)%MASS_FRACTION = .TRUE.
OUTPUT_QUANTITY(144)%SHORT_NAME = 'Y_ELEM'
OUTPUT_QUANTITY(144)%ELEM_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(150)%NAME  = 'SUM LUMPED VOLUME FRACTIONS'
OUTPUT_QUANTITY(150)%UNITS  = ''
OUTPUT_QUANTITY(150)%SHORT_NAME  = 'sum X'

! Sprinklers and Detectors

OUTPUT_QUANTITY(153)%NAME = 'NOZZLE FLOW RATE'
OUTPUT_QUANTITY(153)%UNITS = 'L/min'
OUTPUT_QUANTITY(153)%SHORT_NAME = 'flow'
OUTPUT_QUANTITY(153)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(154)%NAME = 'TRANSMISSION'
OUTPUT_QUANTITY(154)%UNITS = '%/m'
OUTPUT_QUANTITY(154)%SHORT_NAME = 'trans'
OUTPUT_QUANTITY(154)%INTEGRATED = .TRUE.
OUTPUT_QUANTITY(154)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(155)%NAME = 'PATH OBSCURATION'
OUTPUT_QUANTITY(155)%UNITS = '%'
OUTPUT_QUANTITY(155)%SHORT_NAME = 'total obs'
OUTPUT_QUANTITY(155)%INTEGRATED = .TRUE.
OUTPUT_QUANTITY(155)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(156)%NAME = 'SPRINKLER LINK TEMPERATURE'
OUTPUT_QUANTITY(156)%UNITS = 'C'
OUTPUT_QUANTITY(156)%SHORT_NAME = 'link'
OUTPUT_QUANTITY(156)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(157)%NAME = 'LINK TEMPERATURE'
OUTPUT_QUANTITY(157)%UNITS = 'C'
OUTPUT_QUANTITY(157)%SHORT_NAME = 'link'
OUTPUT_QUANTITY(157)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(158)%NAME = 'CHAMBER OBSCURATION'
OUTPUT_QUANTITY(158)%UNITS = '%/m'
OUTPUT_QUANTITY(158)%SHORT_NAME = 'obs'
OUTPUT_QUANTITY(158)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(159)%NAME = 'CONTROL VALUE'
OUTPUT_QUANTITY(159)%UNITS = ' '
OUTPUT_QUANTITY(159)%SHORT_NAME = 'output'
OUTPUT_QUANTITY(159)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(159)%TIME_AVERAGED = .FALSE.

OUTPUT_QUANTITY(160)%NAME = 'CONTROL'
OUTPUT_QUANTITY(160)%UNITS = ' '
OUTPUT_QUANTITY(160)%SHORT_NAME = 'state'
OUTPUT_QUANTITY(160)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(160)%TIME_AVERAGED = .FALSE.

OUTPUT_QUANTITY(161)%NAME = 'ASPIRATION'
OUTPUT_QUANTITY(161)%UNITS = '%/m'
OUTPUT_QUANTITY(161)%SHORT_NAME = 'obs'
OUTPUT_QUANTITY(161)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(163)%NAME = 'PATHLENGTH'
OUTPUT_QUANTITY(163)%UNITS = 'm'
OUTPUT_QUANTITY(163)%SHORT_NAME = 'L'
OUTPUT_QUANTITY(163)%INTEGRATED = .TRUE.
OUTPUT_QUANTITY(163)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(164)%NAME = 'FIRE DEPTH'
OUTPUT_QUANTITY(164)%UNITS = 'm'
OUTPUT_QUANTITY(164)%SHORT_NAME = 'f_d'
OUTPUT_QUANTITY(164)%INTEGRATED = .TRUE.
OUTPUT_QUANTITY(164)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(165)%NAME = 'VELOCITY PATCH'
OUTPUT_QUANTITY(165)%UNITS = ' '
OUTPUT_QUANTITY(165)%SHORT_NAME = 'vel_patch'
OUTPUT_QUANTITY(165)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(165)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(165)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(165)%INTEGRATED = .TRUE.

! PARTICLE mass quantities

OUTPUT_QUANTITY(170)%NAME = 'MPUV'
OUTPUT_QUANTITY(170)%UNITS = 'kg/m3'
OUTPUT_QUANTITY(170)%SHORT_NAME = 'mpuv'

OUTPUT_QUANTITY(171)%NAME = 'ADD'
OUTPUT_QUANTITY(171)%UNITS = 'mu-m'
OUTPUT_QUANTITY(171)%SHORT_NAME = 'diam'

OUTPUT_QUANTITY(172)%NAME = 'ADT'
OUTPUT_QUANTITY(172)%UNITS = 'C'
OUTPUT_QUANTITY(172)%SHORT_NAME = 'temp'

OUTPUT_QUANTITY(173)%NAME = 'ADA'
OUTPUT_QUANTITY(173)%UNITS = 'm2/m3'
OUTPUT_QUANTITY(173)%SHORT_NAME = 'area'

OUTPUT_QUANTITY(174)%NAME = 'QABS'
OUTPUT_QUANTITY(174)%UNITS = ''
OUTPUT_QUANTITY(174)%SHORT_NAME = 'q_abs'

OUTPUT_QUANTITY(175)%NAME = 'QSCA'
OUTPUT_QUANTITY(175)%UNITS = ''
OUTPUT_QUANTITY(175)%SHORT_NAME = 'q_sca'

OUTPUT_QUANTITY(170:175)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(170:175)%PART_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(176)%NAME = 'PARTICLE FLUX X'
OUTPUT_QUANTITY(176)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(176)%SHORT_NAME = 'flux_x'

OUTPUT_QUANTITY(177)%NAME = 'PARTICLE FLUX Y'
OUTPUT_QUANTITY(177)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(177)%SHORT_NAME = 'flux_y'

OUTPUT_QUANTITY(178)%NAME = 'PARTICLE FLUX Z'
OUTPUT_QUANTITY(178)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(178)%SHORT_NAME = 'flux_z'

OUTPUT_QUANTITY(176:178)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(176:178)%INTEGRATED_PARTICLES = .TRUE.

OUTPUT_QUANTITY(179)%NAME = 'MPUV_Z'
OUTPUT_QUANTITY(179)%UNITS = 'kg/m3'
OUTPUT_QUANTITY(179)%SHORT_NAME = 'mpuv_z'

OUTPUT_QUANTITY(180)%NAME = 'ADD_Z'
OUTPUT_QUANTITY(180)%UNITS = 'mu-m'
OUTPUT_QUANTITY(180)%SHORT_NAME = 'diam_z'

OUTPUT_QUANTITY(181)%NAME = 'ADT_Z'
OUTPUT_QUANTITY(181)%UNITS = 'C'
OUTPUT_QUANTITY(181)%SHORT_NAME = 'temp_z'

OUTPUT_QUANTITY(182)%NAME = 'ADA_Z'
OUTPUT_QUANTITY(182)%UNITS = 'm2/m3'
OUTPUT_QUANTITY(182)%SHORT_NAME = 'area_z'

OUTPUT_QUANTITY(183)%NAME = 'QABS_Z'
OUTPUT_QUANTITY(183)%UNITS = ''
OUTPUT_QUANTITY(183)%SHORT_NAME = 'q_abs_z'

OUTPUT_QUANTITY(184)%NAME = 'QSCA_Z'
OUTPUT_QUANTITY(184)%UNITS = ''
OUTPUT_QUANTITY(184)%SHORT_NAME = 'q_sca_z'

OUTPUT_QUANTITY(180:184)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(180:184)%SPEC_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(185)%NAME = 'NUMBER OF PARTICLES'
OUTPUT_QUANTITY(185)%UNITS = '#'
OUTPUT_QUANTITY(185)%SHORT_NAME = 'NLP'
OUTPUT_QUANTITY(185)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(185)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(186)%NAME = 'DROPLET VOLUME FRACTION'
OUTPUT_QUANTITY(186)%UNITS = ''
OUTPUT_QUANTITY(186)%SHORT_NAME = 'dvf'
OUTPUT_QUANTITY(186)%PART_ID_REQUIRED = .TRUE.

! Geometry output

OUTPUT_QUANTITY(190)%NAME = 'CELL PHASE'
OUTPUT_QUANTITY(190)%UNITS = ''
OUTPUT_QUANTITY(190)%SHORT_NAME = 'Cell'
OUTPUT_QUANTITY(190)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(190)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(190)%SLCF_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(190)%SPEC_ID_REQUIRED = .FALSE.

OUTPUT_QUANTITY(191)%NAME = 'SCALAR UNKNOWN NUMBER'
OUTPUT_QUANTITY(191)%UNITS = ''
OUTPUT_QUANTITY(191)%SHORT_NAME = 'UNKZ'
OUTPUT_QUANTITY(191)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(191)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(191)%SLCF_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(191)%SPEC_ID_REQUIRED = .FALSE.

OUTPUT_QUANTITY(192)%NAME = 'F_X UNKNOWN NUMBER'
OUTPUT_QUANTITY(192)%UNITS = ''
OUTPUT_QUANTITY(192)%SHORT_NAME = 'UNKFU'
OUTPUT_QUANTITY(192)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(192)%IOR = 1
OUTPUT_QUANTITY(192)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(192)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(192)%SLCF_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(192)%SPEC_ID_REQUIRED = .FALSE.

OUTPUT_QUANTITY(193)%NAME = 'F_Y UNKNOWN NUMBER'
OUTPUT_QUANTITY(193)%UNITS = ''
OUTPUT_QUANTITY(193)%SHORT_NAME = 'UNKFV'
OUTPUT_QUANTITY(193)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(193)%IOR = 2
OUTPUT_QUANTITY(193)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(193)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(193)%SLCF_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(193)%SPEC_ID_REQUIRED = .FALSE.

OUTPUT_QUANTITY(194)%NAME = 'F_Z UNKNOWN NUMBER'
OUTPUT_QUANTITY(194)%UNITS = ''
OUTPUT_QUANTITY(194)%SHORT_NAME = 'UNKFW'
OUTPUT_QUANTITY(194)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(194)%IOR = 3
OUTPUT_QUANTITY(194)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(194)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(194)%SLCF_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(194)%SPEC_ID_REQUIRED = .FALSE.

! PDPA

OUTPUT_QUANTITY(230)%NAME = 'RANDOM NUMBER'
OUTPUT_QUANTITY(230)%UNITS = ' '
OUTPUT_QUANTITY(230)%SHORT_NAME = ' '
OUTPUT_QUANTITY(230)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(230)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(230)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(230)%TIME_AVERAGED    = .FALSE.

OUTPUT_QUANTITY(231)%NAME = 'PDPA'
OUTPUT_QUANTITY(231)%UNITS = ' '
OUTPUT_QUANTITY(231)%SHORT_NAME = ' '
OUTPUT_QUANTITY(231)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(231)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(231)%SLCF_APPROPRIATE = .FALSE.

! More miscellaneous

OUTPUT_QUANTITY(251)%NAME  = 'WIND CHILL INDEX'
OUTPUT_QUANTITY(251)%UNITS = 'C'
OUTPUT_QUANTITY(251)%SHORT_NAME  = 'WCI'
OUTPUT_QUANTITY(251)%SLCF_APPROPRIATE=.TRUE.
OUTPUT_QUANTITY(251)%ISOF_APPROPRIATE=.FALSE.

OUTPUT_QUANTITY(253)%NAME  = 'ZONE PRESSURE SOLVER TYPE'
OUTPUT_QUANTITY(253)%UNITS  = ' '
OUTPUT_QUANTITY(253)%SHORT_NAME  = 'pres_flag'

OUTPUT_QUANTITY(254)%NAME  = 'PRESSURE ZONE PARENT'
OUTPUT_QUANTITY(254)%UNITS  = ' '
OUTPUT_QUANTITY(254)%SHORT_NAME  = 'zone_par'

! HVAC

OUTPUT_QUANTITY(300:350)%SLCF_APPROPRIATE=.FALSE.
OUTPUT_QUANTITY(300:350)%ISOF_APPROPRIATE=.FALSE.
OUTPUT_QUANTITY(300:350)%GAS_PHASE=.FALSE.
OUTPUT_QUANTITY(300:350)%HVAC=.TRUE.
OUTPUT_QUANTITY(300:350)%HVAC_SMV=.TRUE.

DO N=300,350
   HVAC_SMV_EQUIVALENCE(N) = N
ENDDO

OUTPUT_QUANTITY(300)%NAME = 'DUCT VELOCITY'
OUTPUT_QUANTITY(300)%UNITS = 'm/s'
OUTPUT_QUANTITY(300)%SHORT_NAME = 'vel_d'
OUTPUT_QUANTITY(300)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(301)%NAME = 'DUCT TEMPERATURE'
OUTPUT_QUANTITY(301)%UNITS = 'C'
OUTPUT_QUANTITY(301)%SHORT_NAME = 'temp_d'
OUTPUT_QUANTITY(301)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(302)%NAME = 'DUCT MASS FLOW'
OUTPUT_QUANTITY(302)%UNITS = 'kg/s'
OUTPUT_QUANTITY(302)%SHORT_NAME = 'mot_d'
OUTPUT_QUANTITY(302)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(303)%NAME = 'DUCT VOLUME FLOW'
OUTPUT_QUANTITY(303)%UNITS = 'm3/s'
OUTPUT_QUANTITY(303)%SHORT_NAME = 'vdot_d'
OUTPUT_QUANTITY(303)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(304)%NAME = 'DUCT MASS FRACTION'
OUTPUT_QUANTITY(304)%UNITS = 'kg/kg'
OUTPUT_QUANTITY(304)%SHORT_NAME = 'Y_d'
OUTPUT_QUANTITY(304)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(304)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(305)%NAME = 'DUCT VOLUME FRACTION'
OUTPUT_QUANTITY(305)%UNITS = 'mol/mol'
OUTPUT_QUANTITY(305)%SHORT_NAME = 'X_d'
OUTPUT_QUANTITY(305)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(305)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(306)%NAME = 'DUCT DENSITY'
OUTPUT_QUANTITY(306)%UNITS = 'kg/m3'
OUTPUT_QUANTITY(306)%SHORT_NAME = 'rho_d'
OUTPUT_QUANTITY(306)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(307)%NAME = 'DUCT CELL TEMPERATURE'
OUTPUT_QUANTITY(307)%UNITS = 'C'
OUTPUT_QUANTITY(307)%SHORT_NAME = 'temp_d_c'
OUTPUT_QUANTITY(307)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(307)%CELL_L_REQUIRED=.TRUE.
OUTPUT_QUANTITY(307)%HVAC_SMV=.FALSE.
HVAC_SMV_EQUIVALENCE(301) = 307

OUTPUT_QUANTITY(308)%NAME = 'DUCT CELL DENSITY'
OUTPUT_QUANTITY(308)%UNITS = 'kg/m3'
OUTPUT_QUANTITY(308)%SHORT_NAME = 'rho_d_c'
OUTPUT_QUANTITY(308)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(308)%CELL_L_REQUIRED=.TRUE.
OUTPUT_QUANTITY(308)%HVAC_SMV=.FALSE.
HVAC_SMV_EQUIVALENCE(306) = 308

OUTPUT_QUANTITY(309)%NAME = 'DUCT CELL MASS FRACTION'
OUTPUT_QUANTITY(309)%UNITS = 'kg/kg'
OUTPUT_QUANTITY(309)%SHORT_NAME = 'Y_d_c'
OUTPUT_QUANTITY(309)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(309)%CELL_L_REQUIRED=.TRUE.
OUTPUT_QUANTITY(309)%SPEC_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(309)%HVAC_SMV=.FALSE.
HVAC_SMV_EQUIVALENCE(304) = 309

OUTPUT_QUANTITY(310)%NAME = 'DUCT CELL VOLUME FRACTION'
OUTPUT_QUANTITY(310)%UNITS = 'mol/mol'
OUTPUT_QUANTITY(310)%SHORT_NAME = 'X_d_c'
OUTPUT_QUANTITY(310)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(310)%CELL_L_REQUIRED=.TRUE.
OUTPUT_QUANTITY(310)%SPEC_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(310)%HVAC_SMV=.FALSE.
HVAC_SMV_EQUIVALENCE(305) = 310

OUTPUT_QUANTITY(311)%NAME = 'DUCT ENTHALPY FLOW'
OUTPUT_QUANTITY(311)%UNITS = 'kW'
OUTPUT_QUANTITY(311)%SHORT_NAME = 'edot_d'
OUTPUT_QUANTITY(311)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(312)%NAME = 'DUCT LOSS'
OUTPUT_QUANTITY(312)%UNITS = ''
OUTPUT_QUANTITY(312)%SHORT_NAME = 'loss_d'
OUTPUT_QUANTITY(312)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(313)%NAME = 'FAN PRESSURE'
OUTPUT_QUANTITY(313)%UNITS = 'Pa'
OUTPUT_QUANTITY(313)%SHORT_NAME = 'P_fan'
OUTPUT_QUANTITY(313)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(313)%HVAC_SMV=.FALSE.

OUTPUT_QUANTITY(314)%NAME = 'DUCT CONVECTIVE HEAT FLOW'
OUTPUT_QUANTITY(314)%UNITS = 'kW'
OUTPUT_QUANTITY(314)%SHORT_NAME = 'q_con_d'
OUTPUT_QUANTITY(314)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(315)%NAME = 'DUCT RADIATIVE HEAT FLOW'
OUTPUT_QUANTITY(315)%UNITS = 'kW'
OUTPUT_QUANTITY(315)%SHORT_NAME = 'q_rad_d'
OUTPUT_QUANTITY(315)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(316)%NAME = 'DUCT CELL CONVECTIVE HEAT FLOW'
OUTPUT_QUANTITY(316)%UNITS = 'kW'
OUTPUT_QUANTITY(316)%SHORT_NAME = 'q_con_d_c'
OUTPUT_QUANTITY(316)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(316)%CELL_L_REQUIRED=.TRUE.
OUTPUT_QUANTITY(316)%HVAC_SMV=.FALSE.
HVAC_SMV_EQUIVALENCE(314) = 316

OUTPUT_QUANTITY(317)%NAME = 'DUCT CELL RADIATIVE HEAT FLOW'
OUTPUT_QUANTITY(317)%UNITS = 'kW'
OUTPUT_QUANTITY(317)%SHORT_NAME = 'q_rad_d_c'
OUTPUT_QUANTITY(317)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(317)%CELL_L_REQUIRED=.TRUE.
OUTPUT_QUANTITY(317)%HVAC_SMV=.FALSE.
HVAC_SMV_EQUIVALENCE(315) = 317

OUTPUT_QUANTITY(318)%NAME = 'DUCT CELL ENTHALPY FLOW'
OUTPUT_QUANTITY(318)%UNITS = 'kW'
OUTPUT_QUANTITY(318)%SHORT_NAME = 'e_dot_d_c'
OUTPUT_QUANTITY(318)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(318)%CELL_L_REQUIRED=.TRUE.
OUTPUT_QUANTITY(318)%HVAC_SMV=.FALSE.
HVAC_SMV_EQUIVALENCE(311) = 318

OUTPUT_QUANTITY(330)%NAME = 'NODE PRESSURE'
OUTPUT_QUANTITY(330)%UNITS = 'Pa'
OUTPUT_QUANTITY(330)%SHORT_NAME = 'P_n'
OUTPUT_QUANTITY(330)%NODE_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(331)%NAME = 'NODE DENSITY'
OUTPUT_QUANTITY(331)%UNITS = 'kg/m3'
OUTPUT_QUANTITY(331)%SHORT_NAME = 'rho_n'
OUTPUT_QUANTITY(331)%NODE_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(332)%NAME = 'NODE TEMPERATURE'
OUTPUT_QUANTITY(332)%UNITS = 'C'
OUTPUT_QUANTITY(332)%SHORT_NAME = 'T_n'
OUTPUT_QUANTITY(332)%NODE_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(333)%NAME = 'NODE MASS FRACTION'
OUTPUT_QUANTITY(333)%UNITS = 'kg/kg'
OUTPUT_QUANTITY(333)%SHORT_NAME = 'Y_n'
OUTPUT_QUANTITY(333)%NODE_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(333)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(334)%NAME = 'NODE VOLUME FRACTION'
OUTPUT_QUANTITY(334)%UNITS = 'mol/mol'
OUTPUT_QUANTITY(334)%SHORT_NAME = 'X_n'
OUTPUT_QUANTITY(334)%NODE_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(334)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(335)%NAME = 'NODE PRESSURE DIFFERENCE'
OUTPUT_QUANTITY(335)%UNITS = 'Pa'
OUTPUT_QUANTITY(335)%SHORT_NAME = 'deltaP'
OUTPUT_QUANTITY(335)%NODE_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(335)%HVAC_SMV=.FALSE.

OUTPUT_QUANTITY(336)%NAME = 'FILTER LOADING'
OUTPUT_QUANTITY(336)%UNITS = 'kg'
OUTPUT_QUANTITY(336)%SHORT_NAME = 'Loading'
OUTPUT_QUANTITY(336)%NODE_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(336)%SPEC_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(336)%HVAC_SMV=.FALSE.

OUTPUT_QUANTITY(337)%NAME = 'AIRCOIL HEAT EXCHANGE'
OUTPUT_QUANTITY(337)%UNITS = 'kW'
OUTPUT_QUANTITY(337)%SHORT_NAME = 'aircq'
OUTPUT_QUANTITY(337)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(337)%HVAC_SMV=.FALSE.

OUTPUT_QUANTITY(338)%NAME = 'FILTER LOSS'
OUTPUT_QUANTITY(338)%UNITS = ''
OUTPUT_QUANTITY(338)%SHORT_NAME = 'Loss'
OUTPUT_QUANTITY(338)%NODE_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(338)%HVAC_SMV=.FALSE.

OUTPUT_QUANTITY(339)%NAME = 'NODE ENTHALPY'
OUTPUT_QUANTITY(339)%UNITS = 'kJ/kg'
OUTPUT_QUANTITY(339)%SHORT_NAME = 'h_n'
OUTPUT_QUANTITY(339)%NODE_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(340)%NAME = 'NODE SENSIBLE ENTHALPY'
OUTPUT_QUANTITY(340)%UNITS = 'kJ/kg'
OUTPUT_QUANTITY(340)%SHORT_NAME = 'h_sens,n'
OUTPUT_QUANTITY(340)%NODE_ID_REQUIRED=.TRUE.

! QUANTITYs that refer to PARTICLE properties that are used to color the PARTICLEs in Smokeview

OUTPUT_QUANTITY(434)%NAME = 'PARTICLE DIAMETER'
OUTPUT_QUANTITY(434)%OLD_NAME = 'DROPLET_DIAMETER'
OUTPUT_QUANTITY(434)%UNITS = 'mu-m'
OUTPUT_QUANTITY(434)%SHORT_NAME = 'diam'

OUTPUT_QUANTITY(435)%NAME = 'PARTICLE VELOCITY'
OUTPUT_QUANTITY(435)%OLD_NAME = 'DROPLET_VELOCITY'
OUTPUT_QUANTITY(435)%UNITS = 'm/s'
OUTPUT_QUANTITY(435)%SHORT_NAME = 'vel'

OUTPUT_QUANTITY(436)%NAME = 'PARTICLE PHASE'
OUTPUT_QUANTITY(436)%UNITS = ' '
OUTPUT_QUANTITY(436)%SHORT_NAME = 'ior'

OUTPUT_QUANTITY(437)%NAME = 'PARTICLE TEMPERATURE'
OUTPUT_QUANTITY(437)%OLD_NAME = 'DROPLET_TEMPERATURE'
OUTPUT_QUANTITY(437)%UNITS = 'C'
OUTPUT_QUANTITY(437)%SHORT_NAME = 'temp'

OUTPUT_QUANTITY(438)%NAME = 'PARTICLE MASS'
OUTPUT_QUANTITY(438)%UNITS = 'kg'
OUTPUT_QUANTITY(438)%SHORT_NAME = 'mass'

OUTPUT_QUANTITY(439)%NAME = 'PARTICLE AGE'
OUTPUT_QUANTITY(439)%UNITS = 's'
OUTPUT_QUANTITY(439)%SHORT_NAME = 'age'

OUTPUT_QUANTITY(440)%NAME = 'PARTICLE WEIGHTING FACTOR'
OUTPUT_QUANTITY(440)%UNITS = ' '
OUTPUT_QUANTITY(440)%SHORT_NAME = 'pwt'

OUTPUT_QUANTITY(441)%NAME = 'PARTICLE X'
OUTPUT_QUANTITY(441)%UNITS = 'm'
OUTPUT_QUANTITY(441)%SHORT_NAME = 'x'

OUTPUT_QUANTITY(442)%NAME = 'PARTICLE Y'
OUTPUT_QUANTITY(442)%UNITS = 'm'
OUTPUT_QUANTITY(442)%SHORT_NAME = 'y'

OUTPUT_QUANTITY(443)%NAME = 'PARTICLE Z'
OUTPUT_QUANTITY(443)%UNITS = 'm'
OUTPUT_QUANTITY(443)%SHORT_NAME = 'z'

OUTPUT_QUANTITY(444)%NAME = 'PARTICLE U'
OUTPUT_QUANTITY(444)%UNITS = 'm/s'
OUTPUT_QUANTITY(444)%SHORT_NAME = 'u'

OUTPUT_QUANTITY(445)%NAME = 'PARTICLE V'
OUTPUT_QUANTITY(445)%UNITS = 'm/s'
OUTPUT_QUANTITY(445)%SHORT_NAME = 'v'

OUTPUT_QUANTITY(446)%NAME = 'PARTICLE W'
OUTPUT_QUANTITY(446)%UNITS = 'm/s'
OUTPUT_QUANTITY(446)%SHORT_NAME = 'w'

OUTPUT_QUANTITY(447)%NAME = 'PARTICLE ACCEL X'
OUTPUT_QUANTITY(447)%UNITS = 'm/s2'
OUTPUT_QUANTITY(447)%SHORT_NAME = 'du/dt'

OUTPUT_QUANTITY(448)%NAME = 'PARTICLE ACCEL Y'
OUTPUT_QUANTITY(448)%UNITS = 'm/s2'
OUTPUT_QUANTITY(448)%SHORT_NAME = 'dv/dt'

OUTPUT_QUANTITY(449)%NAME = 'PARTICLE ACCEL Z'
OUTPUT_QUANTITY(449)%UNITS = 'm/s2'
OUTPUT_QUANTITY(449)%SHORT_NAME = 'dw/dt'

OUTPUT_QUANTITY(450)%NAME = 'PARTICLE DRAG FORCE X'
OUTPUT_QUANTITY(450)%UNITS = 'N'
OUTPUT_QUANTITY(450)%SHORT_NAME = 'fx_drag'

OUTPUT_QUANTITY(451)%NAME = 'PARTICLE DRAG FORCE Y'
OUTPUT_QUANTITY(451)%UNITS = 'N'
OUTPUT_QUANTITY(451)%SHORT_NAME = 'fy_drag'

OUTPUT_QUANTITY(452)%NAME = 'PARTICLE DRAG FORCE Z'
OUTPUT_QUANTITY(452)%UNITS = 'N'
OUTPUT_QUANTITY(452)%SHORT_NAME = 'fz_drag'

OUTPUT_QUANTITY(453)%NAME = 'PARTICLE DRAG COEFFICIENT'
OUTPUT_QUANTITY(453)%UNITS = ''
OUTPUT_QUANTITY(453)%SHORT_NAME = 'C_d'

OUTPUT_QUANTITY(454)%NAME = 'PARTICLE BULK DENSITY'
OUTPUT_QUANTITY(454)%UNITS = 'kg/m3'
OUTPUT_QUANTITY(454)%SHORT_NAME = 'bulk density'

OUTPUT_QUANTITY(455)%NAME = 'PARTICLE HEAT TRANSFER COEFFICIENT'
OUTPUT_QUANTITY(455)%UNITS = 'W/m2/K'
OUTPUT_QUANTITY(455)%SHORT_NAME = 'htc'

OUTPUT_QUANTITY(456)%NAME = 'PARTICLE RADIATIVE HEAT FLUX'
OUTPUT_QUANTITY(456)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(456)%SHORT_NAME = 'qrad'

OUTPUT_QUANTITY(457)%NAME = 'PARTICLE CONVECTIVE HEAT FLUX'
OUTPUT_QUANTITY(457)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(457)%SHORT_NAME = 'qcon'

OUTPUT_QUANTITY(458)%NAME = 'PARTICLE TOTAL HEAT FLUX'
OUTPUT_QUANTITY(458)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(458)%SHORT_NAME = 'qtot'

OUTPUT_QUANTITY(459)%NAME = 'PARTICLE POWER'
OUTPUT_QUANTITY(459)%UNITS = 'kW'
OUTPUT_QUANTITY(459)%SHORT_NAME = 'qdot'

OUTPUT_QUANTITY(434:459)%PART_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(434:459)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(434:459)%DEVC_APPROPRIATE = .TRUE.

! Test outputs

OUTPUT_QUANTITY(500)%NAME = 'PRESSURE MMS'
OUTPUT_QUANTITY(500)%UNITS = 'Pa'
OUTPUT_QUANTITY(500)%SHORT_NAME = 'p_mms'

OUTPUT_QUANTITY(501)%NAME = 'H MMS'
OUTPUT_QUANTITY(501)%UNITS = '(m/s)^2'
OUTPUT_QUANTITY(501)%SHORT_NAME = 'h_mms'

OUTPUT_QUANTITY(502)%NAME = 'CHI_R'
OUTPUT_QUANTITY(502)%UNITS = 'kW/kW'
OUTPUT_QUANTITY(502)%SHORT_NAME = 'chi_r'

OUTPUT_QUANTITY(504)%NAME = 'CFL 1'
OUTPUT_QUANTITY(504)%UNITS = ''
OUTPUT_QUANTITY(504)%SHORT_NAME = 'cfl 1'

OUTPUT_QUANTITY(505)%NAME = 'CFL 3'
OUTPUT_QUANTITY(505)%UNITS = ''
OUTPUT_QUANTITY(505)%SHORT_NAME = 'cfl 3'

OUTPUT_QUANTITY(504:506)%DEVC_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(504:506)%INTEGRATED = .TRUE.

OUTPUT_QUANTITY(508)%NAME = 'IDEAL GAS PRESSURE'
OUTPUT_QUANTITY(508)%UNITS = 'Pa'
OUTPUT_QUANTITY(508)%SHORT_NAME = 'pbar'

OUTPUT_QUANTITY(513)%NAME = 'DHDX'
OUTPUT_QUANTITY(513)%UNITS = 'm/s2'
OUTPUT_QUANTITY(513)%SHORT_NAME = 'dHdx'
OUTPUT_QUANTITY(513)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(513)%IOR = 1

OUTPUT_QUANTITY(514)%NAME = 'DHDY'
OUTPUT_QUANTITY(514)%UNITS = 'm/s2'
OUTPUT_QUANTITY(514)%SHORT_NAME = 'dHdy'
OUTPUT_QUANTITY(514)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(514)%IOR = 2

OUTPUT_QUANTITY(515)%NAME = 'DHDZ'
OUTPUT_QUANTITY(515)%UNITS = 'm/s2'
OUTPUT_QUANTITY(515)%SHORT_NAME = 'dHdz'
OUTPUT_QUANTITY(515)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(515)%IOR = 3

OUTPUT_QUANTITY(510:515)%DEVC_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(510:515)%INTEGRATED = .TRUE.

OUTPUT_QUANTITY(523)%NAME = 'ABSOLUTE PRESSURE'
OUTPUT_QUANTITY(523)%UNITS = 'Pa'
OUTPUT_QUANTITY(523)%SHORT_NAME = 'P_abs'

OUTPUT_QUANTITY(528)%NAME = 'ADVECTIVE MASS FLUX X'
OUTPUT_QUANTITY(528)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(528)%SHORT_NAME = 'rho*Z*u'
OUTPUT_QUANTITY(528)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(528)%IOR = 1
OUTPUT_QUANTITY(528)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(529)%NAME = 'ADVECTIVE MASS FLUX Y'
OUTPUT_QUANTITY(529)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(529)%SHORT_NAME = 'rho*Z*v'
OUTPUT_QUANTITY(529)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(529)%IOR = 2
OUTPUT_QUANTITY(529)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(530)%NAME = 'ADVECTIVE MASS FLUX Z'
OUTPUT_QUANTITY(530)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(530)%SHORT_NAME = 'rho*Z*w'
OUTPUT_QUANTITY(530)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(530)%IOR = 3
OUTPUT_QUANTITY(530)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(531)%NAME = 'DIFFUSIVE MASS FLUX X'
OUTPUT_QUANTITY(531)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(531)%SHORT_NAME = 'rho*D*dZ/dx'
OUTPUT_QUANTITY(531)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(531)%IOR = 1
OUTPUT_QUANTITY(531)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(532)%NAME = 'DIFFUSIVE MASS FLUX Y'
OUTPUT_QUANTITY(532)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(532)%SHORT_NAME = 'rho*D*dZ/dy'
OUTPUT_QUANTITY(532)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(532)%IOR = 2
OUTPUT_QUANTITY(532)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(533)%NAME = 'DIFFUSIVE MASS FLUX Z'
OUTPUT_QUANTITY(533)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(533)%SHORT_NAME = 'rho*D*dZ/dz'
OUTPUT_QUANTITY(533)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(533)%IOR = 3
OUTPUT_QUANTITY(533)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(534)%NAME = 'TOTAL MASS FLUX X'
OUTPUT_QUANTITY(534)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(534)%SHORT_NAME = 'rho*(Z*u + D*dZ/dx)'
OUTPUT_QUANTITY(534)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(534)%IOR = 1
!OUTPUT_QUANTITY(534)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(535)%NAME = 'TOTAL MASS FLUX Y'
OUTPUT_QUANTITY(535)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(535)%SHORT_NAME = 'rho*(Z*v + D*dZ/dy)'
OUTPUT_QUANTITY(535)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(535)%IOR = 2
!OUTPUT_QUANTITY(535)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(536)%NAME = 'TOTAL MASS FLUX Z'
OUTPUT_QUANTITY(536)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(536)%SHORT_NAME = 'rho*(Z*w + D*dZ/dz)'
OUTPUT_QUANTITY(536)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(536)%IOR = 3
!OUTPUT_QUANTITY(536)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(550)%NAME = 'CUTCELL VELOCITY DIVERGENCE'
OUTPUT_QUANTITY(550)%UNITS = '1/s'
OUTPUT_QUANTITY(550)%SHORT_NAME = 'cc_div'

OUTPUT_QUANTITY(551)%NAME = 'CARTESIAN VELOCITY DIVERGENCE'
OUTPUT_QUANTITY(551)%UNITS = '1/s'
OUTPUT_QUANTITY(551)%SHORT_NAME = 'cart_div'

OUTPUT_QUANTITY(552)%NAME  = 'U_LS'
OUTPUT_QUANTITY(552)%UNITS  = 'm/s'
OUTPUT_QUANTITY(552)%SHORT_NAME  = 'U_LS'

OUTPUT_QUANTITY(553)%NAME  = 'V_LS'
OUTPUT_QUANTITY(553)%UNITS  = 'm/s'
OUTPUT_QUANTITY(553)%SHORT_NAME  = 'V_LS'

! Boundary Quantities (Negative indices)

OUTPUT_QUANTITY(-1)%NAME = 'RADIATIVE HEAT FLUX'
OUTPUT_QUANTITY(-1)%OLD_NAME = 'RADIATIVE HEAT FLUX GAS'
OUTPUT_QUANTITY(-1)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(-1)%SHORT_NAME = 'rad'

OUTPUT_QUANTITY(-2)%NAME = 'CONVECTIVE HEAT FLUX'
OUTPUT_QUANTITY(-2)%OLD_NAME = 'CONVECTIVE_FLUX'
OUTPUT_QUANTITY(-2)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(-2)%SHORT_NAME = 'con'

OUTPUT_QUANTITY(-3)%NAME = 'NORMAL VELOCITY'
OUTPUT_QUANTITY(-3)%UNITS = 'm/s'
OUTPUT_QUANTITY(-3)%SHORT_NAME = 'vel'

OUTPUT_QUANTITY(-4)%NAME = 'GAS TEMPERATURE'
OUTPUT_QUANTITY(-4)%UNITS = 'C'
OUTPUT_QUANTITY(-4)%SHORT_NAME = 'temp'

OUTPUT_QUANTITY(-5)%NAME = 'WALL TEMPERATURE'
OUTPUT_QUANTITY(-5)%OLD_NAME = 'WALL_TEMPERATURE'
OUTPUT_QUANTITY(-5)%UNITS = 'C'
OUTPUT_QUANTITY(-5)%SHORT_NAME = 'temp'

OUTPUT_QUANTITY(-6)%NAME = 'INSIDE WALL TEMPERATURE'
OUTPUT_QUANTITY(-6)%OLD_NAME = 'INSIDE_WALL_TEMPERATURE'
OUTPUT_QUANTITY(-6)%UNITS = 'C'
OUTPUT_QUANTITY(-6)%SHORT_NAME = 'inside'
OUTPUT_QUANTITY(-6)%INSIDE_SOLID = .TRUE.
OUTPUT_QUANTITY(-6)%BNDF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(-6)%PROF_APPROPRIATE = .TRUE.

OUTPUT_QUANTITY(-7)%NAME = 'BURNING RATE'
OUTPUT_QUANTITY(-7)%OLD_NAME = 'BURNING_RATE'
OUTPUT_QUANTITY(-7)%UNITS = 'kg/m2/s'
OUTPUT_QUANTITY(-7)%SHORT_NAME = 'burn'

OUTPUT_QUANTITY(-8)%NAME = 'NORMALIZED HEAT RELEASE RATE'
OUTPUT_QUANTITY(-8)%UNITS = 'kW/kg'
OUTPUT_QUANTITY(-8)%SHORT_NAME = 'hrrpum'
OUTPUT_QUANTITY(-8)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-9)%NAME = 'HRRPUA'
OUTPUT_QUANTITY(-9)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(-9)%SHORT_NAME = 'hrrpua'

OUTPUT_QUANTITY(-10)%NAME= 'TOTAL HEAT FLUX'
OUTPUT_QUANTITY(-10)%OLD_NAME= 'NET HEAT FLUX'
OUTPUT_QUANTITY(-10)%UNITS= 'kW/m2'
OUTPUT_QUANTITY(-10)%SHORT_NAME= 'net'

OUTPUT_QUANTITY(-11)%NAME= 'PRESSURE COEFFICIENT'
OUTPUT_QUANTITY(-11)%OLD_NAME= 'PRESSURE_COEFFICIENT'
OUTPUT_QUANTITY(-11)%UNITS= ' '
OUTPUT_QUANTITY(-11)%SHORT_NAME= 'c_p'

OUTPUT_QUANTITY(-12)%NAME= 'BACK WALL TEMPERATURE'
OUTPUT_QUANTITY(-12)%OLD_NAME= 'BACK_WALL_TEMPERATURE'
OUTPUT_QUANTITY(-12)%UNITS= 'C'
OUTPUT_QUANTITY(-12)%SHORT_NAME= 'back'

OUTPUT_QUANTITY(-13)%NAME= 'GAUGE HEAT FLUX'
OUTPUT_QUANTITY(-13)%OLD_NAME= 'GAUGE HEAT FLUX GAS'
OUTPUT_QUANTITY(-13)%UNITS= 'kW/m2'
OUTPUT_QUANTITY(-13)%SHORT_NAME= 'gauge'

OUTPUT_QUANTITY(-14)%NAME = 'NORMALIZED HEATING RATE'
OUTPUT_QUANTITY(-14)%UNITS = 'W/g'
OUTPUT_QUANTITY(-14)%SHORT_NAME = 'DSC'
OUTPUT_QUANTITY(-14)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-15)%NAME = 'MASS FLUX'
OUTPUT_QUANTITY(-15)%OLD_NAME = 'MASS_FLUX'
OUTPUT_QUANTITY(-15)%UNITS= 'kg/s/m2'
OUTPUT_QUANTITY(-15)%SHORT_NAME = 'mass_flux'

OUTPUT_QUANTITY(-16)%NAME = 'NORMALIZED MASS LOSS RATE'
OUTPUT_QUANTITY(-16)%UNITS= '1/s'
OUTPUT_QUANTITY(-16)%SHORT_NAME = 'rr'
OUTPUT_QUANTITY(-16)%SPEC_ID_REQUIRED = .FALSE.
OUTPUT_QUANTITY(-16)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-17)%NAME = 'RADIANCE'
OUTPUT_QUANTITY(-17)%UNITS = 'kW/m2/sr'
OUTPUT_QUANTITY(-17)%SHORT_NAME = 'rad'
OUTPUT_QUANTITY(-17)%BNDF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(-17)%PART_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-20)%NAME= 'INCIDENT HEAT FLUX'
OUTPUT_QUANTITY(-20)%UNITS= 'kW/m2'
OUTPUT_QUANTITY(-20)%SHORT_NAME= 'in_flux'

OUTPUT_QUANTITY(-21)%NAME= 'HEAT TRANSFER COEFFICIENT'
OUTPUT_QUANTITY(-21)%UNITS= 'W/m2/K'
OUTPUT_QUANTITY(-21)%SHORT_NAME= 'h'

OUTPUT_QUANTITY(-22)%NAME= 'RADIOMETER'
OUTPUT_QUANTITY(-22)%OLD_NAME= 'RADIOMETER GAS'
OUTPUT_QUANTITY(-22)%UNITS= 'kW/m2'
OUTPUT_QUANTITY(-22)%SHORT_NAME= 'radio'

OUTPUT_QUANTITY(-23)%NAME= 'ADIABATIC SURFACE TEMPERATURE'
OUTPUT_QUANTITY(-23)%OLD_NAME= 'ADIABATIC SURFACE TEMPERATURE GAS'
OUTPUT_QUANTITY(-23)%UNITS= 'C'
OUTPUT_QUANTITY(-23)%SHORT_NAME= 'AST'
OUTPUT_QUANTITY(-23)%PART_APPROPRIATE = .TRUE.

OUTPUT_QUANTITY(-24)%NAME= 'WALL THICKNESS'
OUTPUT_QUANTITY(-24)%UNITS= 'm'
OUTPUT_QUANTITY(-24)%SHORT_NAME= 'thick'

OUTPUT_QUANTITY(-25)%NAME= 'SURFACE DENSITY'
OUTPUT_QUANTITY(-25)%UNITS= 'kg/m2'
OUTPUT_QUANTITY(-25)%SHORT_NAME= 'dens'

OUTPUT_QUANTITY(-26)%NAME= 'NORMALIZED MASS'
OUTPUT_QUANTITY(-26)%UNITS= 'kg/kg'
OUTPUT_QUANTITY(-26)%SHORT_NAME= 'm/m0'
OUTPUT_QUANTITY(-26)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-27)%NAME= 'SOLID DENSITY'
OUTPUT_QUANTITY(-27)%UNITS= 'kg/m3'
OUTPUT_QUANTITY(-27)%SHORT_NAME= 'rho_s'
OUTPUT_QUANTITY(-27)%INSIDE_SOLID = .TRUE.
OUTPUT_QUANTITY(-27)%BNDF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(-27)%PROF_APPROPRIATE = .TRUE.

OUTPUT_QUANTITY(-28)%NAME= 'EMISSIVITY'
OUTPUT_QUANTITY(-28)%UNITS= ''
OUTPUT_QUANTITY(-28)%SHORT_NAME= 'emiss'

OUTPUT_QUANTITY(-29)%NAME= 'SURFACE DEPOSITION'
OUTPUT_QUANTITY(-29)%UNITS= 'kg/m2'
OUTPUT_QUANTITY(-29)%SHORT_NAME= 'depo'
OUTPUT_QUANTITY(-29)%SPEC_ID_REQUIRED=.TRUE.

! Solid Phase Particle Outputs

OUTPUT_QUANTITY(-30)%NAME = 'MPUA'
OUTPUT_QUANTITY(-30)%UNITS = 'kg/m2'
OUTPUT_QUANTITY(-30)%SHORT_NAME = 'mpua'

OUTPUT_QUANTITY(-31)%NAME = 'CPUA'
OUTPUT_QUANTITY(-31)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(-31)%SHORT_NAME = 'cpua'

OUTPUT_QUANTITY(-32)%NAME = 'AMPUA'
OUTPUT_QUANTITY(-32)%UNITS= 'kg/m2'
OUTPUT_QUANTITY(-32)%SHORT_NAME = 'ampua'

OUTPUT_QUANTITY(-32:-30)%PART_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(-33)%NAME= 'SOLID SPECIFIC HEAT'
OUTPUT_QUANTITY(-33)%UNITS= 'kJ/kg/K'
OUTPUT_QUANTITY(-33)%SHORT_NAME= 'cp_s'
OUTPUT_QUANTITY(-33)%INSIDE_SOLID = .TRUE.
OUTPUT_QUANTITY(-33)%PROF_APPROPRIATE = .TRUE.

OUTPUT_QUANTITY(-34)%NAME= 'SOLID CONDUCTIVITY'
OUTPUT_QUANTITY(-34)%UNITS= 'W/m/K'
OUTPUT_QUANTITY(-34)%SHORT_NAME= 'k_s'
OUTPUT_QUANTITY(-34)%INSIDE_SOLID = .TRUE.
OUTPUT_QUANTITY(-34)%PROF_APPROPRIATE = .TRUE.

OUTPUT_QUANTITY(-35)%NAME= 'VISCOUS WALL UNITS'
OUTPUT_QUANTITY(-35)%UNITS= ' '
OUTPUT_QUANTITY(-35)%SHORT_NAME= 'y+'

OUTPUT_QUANTITY(-36)%NAME= 'FRICTION VELOCITY'
OUTPUT_QUANTITY(-36)%UNITS= 'm/s'
OUTPUT_QUANTITY(-36)%SHORT_NAME= 'u_tau'

OUTPUT_QUANTITY(-37)%NAME= 'VELOCITY ERROR'
OUTPUT_QUANTITY(-37)%UNITS= 'm/s'
OUTPUT_QUANTITY(-37)%SHORT_NAME= 'verr'

OUTPUT_QUANTITY(-38)%NAME= 'WALL VISCOSITY'
OUTPUT_QUANTITY(-38)%UNITS= 'kg/m/s'
OUTPUT_QUANTITY(-38)%SHORT_NAME= 'mu_w'

OUTPUT_QUANTITY(-39)%NAME= 'DEPOSITION VELOCITY'
OUTPUT_QUANTITY(-39)%UNITS= 'm/s'
OUTPUT_QUANTITY(-39)%SHORT_NAME= 'v_dep'

OUTPUT_QUANTITY(-40)%NAME= 'PRESSURE COEFFICIENT TEST'
OUTPUT_QUANTITY(-40)%UNITS= ' '
OUTPUT_QUANTITY(-40)%SHORT_NAME= 'c_p'

OUTPUT_QUANTITY(-41)%NAME= 'WALL CELL COLOR'
OUTPUT_QUANTITY(-41)%UNITS= ' '
OUTPUT_QUANTITY(-41)%SHORT_NAME= 'wc'

OUTPUT_QUANTITY(-42)%NAME = 'MPUA_Z'
OUTPUT_QUANTITY(-42)%UNITS = 'kg/m2'
OUTPUT_QUANTITY(-42)%SHORT_NAME = 'mpua_z'

OUTPUT_QUANTITY(-43)%NAME = 'CPUA_Z'
OUTPUT_QUANTITY(-43)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(-43)%SHORT_NAME = 'cpua_z'

OUTPUT_QUANTITY(-44)%NAME = 'AMPUA_Z'
OUTPUT_QUANTITY(-44)%UNITS= 'kg/m2'
OUTPUT_QUANTITY(-44)%SHORT_NAME = 'ampua_z'

OUTPUT_QUANTITY(-44:-42)%SPEC_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(-45)%NAME= 'WALL CELL BOUNDARY TYPE'
OUTPUT_QUANTITY(-45)%UNITS= ' '
OUTPUT_QUANTITY(-45)%SHORT_NAME= 'bc type'

OUTPUT_QUANTITY(-46)%NAME= 'WALL CELL THERMAL BOUNDARY TYPE'
OUTPUT_QUANTITY(-46)%UNITS= ' '
OUTPUT_QUANTITY(-46)%SHORT_NAME= 'thermal bc'

OUTPUT_QUANTITY(-47)%NAME= 'INSIDE WALL DEPTH' ! for use with INSIDE WALL TEMPERATURE
OUTPUT_QUANTITY(-47)%UNITS= 'm'
OUTPUT_QUANTITY(-47)%SHORT_NAME= 'depth'
OUTPUT_QUANTITY(-47)%INSIDE_SOLID = .TRUE.
OUTPUT_QUANTITY(-47)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-48)%NAME= 'LAYER DIVIDE DEPTH'
OUTPUT_QUANTITY(-48)%UNITS= 'm'
OUTPUT_QUANTITY(-48)%SHORT_NAME= 'ld-depth'

OUTPUT_QUANTITY(-51)%NAME = 'ENTHALPY FLUX WALL'
OUTPUT_QUANTITY(-51)%UNITS= 'kW/m2'
OUTPUT_QUANTITY(-51)%SHORT_NAME = 'hf'

OUTPUT_QUANTITY(-60)%NAME = 'MASS FLUX WALL'
OUTPUT_QUANTITY(-60)%UNITS= 'kg/s/m2'
OUTPUT_QUANTITY(-60)%SHORT_NAME = 'mflux'

OUTPUT_QUANTITY(-61)%NAME = 'GAS DENSITY'
OUTPUT_QUANTITY(-61)%UNITS= 'kg/m3'
OUTPUT_QUANTITY(-61)%SHORT_NAME = 'rho'

OUTPUT_QUANTITY(-63)%NAME = 'THERMAL WALL UNITS'
OUTPUT_QUANTITY(-63)%UNITS= ' '
OUTPUT_QUANTITY(-63)%SHORT_NAME = 'z*'

OUTPUT_QUANTITY(-64)%NAME = 'TOTAL MASS FLUX WALL'
OUTPUT_QUANTITY(-64)%UNITS= 'kg/s/m2'
OUTPUT_QUANTITY(-64)%SHORT_NAME = 'mflux_wall'

OUTPUT_QUANTITY(-65)%NAME = 'WALL PRESSURE'
OUTPUT_QUANTITY(-65)%UNITS= 'N/m2'
OUTPUT_QUANTITY(-65)%SHORT_NAME = 'p_n'

OUTPUT_QUANTITY(-66)%NAME = 'VISCOUS STRESS WALL'
OUTPUT_QUANTITY(-66)%UNITS= 'N/m2'
OUTPUT_QUANTITY(-66)%SHORT_NAME = 'tau_w'

OUTPUT_QUANTITY(-67)%NAME = 'WALL PRESSURE TEST'
OUTPUT_QUANTITY(-67)%UNITS= 'N/m2'
OUTPUT_QUANTITY(-67)%SHORT_NAME = 'p_n'

OUTPUT_QUANTITY(-68)%NAME = 'LEVEL SET'
OUTPUT_QUANTITY(-68)%UNITS= ''
OUTPUT_QUANTITY(-68)%SHORT_NAME = 'phi_ls'

OUTPUT_QUANTITY(-69)%NAME = 'WALL ENTHALPY'
OUTPUT_QUANTITY(-69)%UNITS= 'kJ'
OUTPUT_QUANTITY(-69)%SHORT_NAME = 'h_w'

OUTPUT_QUANTITY(-70)%NAME = 'SUBSTEPS'
OUTPUT_QUANTITY(-70)%UNITS= ' '
OUTPUT_QUANTITY(-70)%SHORT_NAME = 'sub'

OUTPUT_QUANTITY(-71)%NAME= 'EFFECTIVE HEAT TRANSFER COEFFICIENT'
OUTPUT_QUANTITY(-71)%UNITS= 'W/m2/K'
OUTPUT_QUANTITY(-71)%SHORT_NAME= 'h_eff'

! Smoothed heat flux for scaling pyrolysis
OUTPUT_QUANTITY(-72)%NAME = 'REFERENCE HEAT FLUX'
OUTPUT_QUANTITY(-72)%OLD_NAME = 'REFERENCE_HEAT_FLUX'
OUTPUT_QUANTITY(-72)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(-72)%SHORT_NAME = 'ref_hf'

OUTPUT_QUANTITY(-73)%NAME = 'VEGETATION FUEL TYPE'
OUTPUT_QUANTITY(-73)%UNITS = ''
OUTPUT_QUANTITY(-73)%SHORT_NAME = 'fuel_id'

OUTPUT_QUANTITY(-74)%NAME = 'SOLID MASS FRACTION'
OUTPUT_QUANTITY(-74)%UNITS = 'kg/kg'
OUTPUT_QUANTITY(-74)%SHORT_NAME = 'Y_alpha'
OUTPUT_QUANTITY(-74)%MATL_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(-74)%INSIDE_SOLID = .TRUE.
OUTPUT_QUANTITY(-74)%BNDF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(-74)%PROF_APPROPRIATE = .TRUE.

OUTPUT_QUANTITY(-75)%NAME = 'SOLID ENTHALPY'
OUTPUT_QUANTITY(-75)%UNITS = 'kJ/m3'
OUTPUT_QUANTITY(-75)%SHORT_NAME = 'H_s'
OUTPUT_QUANTITY(-75)%INSIDE_SOLID = .TRUE.
OUTPUT_QUANTITY(-75)%BNDF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(-75)%PROF_APPROPRIATE = .TRUE.

OUTPUT_QUANTITY(-76)%NAME= 'CONVECTIVE HEAT FLUX GAUGE'
OUTPUT_QUANTITY(-76)%UNITS= 'kW/m2'
OUTPUT_QUANTITY(-76)%SHORT_NAME= 'g_con'

OUTPUT_QUANTITY(-77)%NAME= 'CONVECTIVE HEAT TRANSFER REGIME'
OUTPUT_QUANTITY(-77)%UNITS= ''
OUTPUT_QUANTITY(-77)%SHORT_NAME= '1=N,2=F,3=I,4=R'

OUTPUT_QUANTITY(-78)%NAME = 'SURFACE OXYGEN MASS FRACTION'
OUTPUT_QUANTITY(-78)%UNITS= 'kg/kg'
OUTPUT_QUANTITY(-78)%SHORT_NAME = 'Y_O2_F'
OUTPUT_QUANTITY(-78)%BNDF_APPROPRIATE = .TRUE.

OUTPUT_QUANTITY(-79)%NAME = 'SURFACE OXYGEN ITERATIONS'
OUTPUT_QUANTITY(-79)%UNITS= ''
OUTPUT_QUANTITY(-79)%SHORT_NAME = 'O2_iter'
OUTPUT_QUANTITY(-79)%BNDF_APPROPRIATE = .TRUE.

OUTPUT_QUANTITY(-80)%NAME = 'OXIDATIVE HRRPUA'
OUTPUT_QUANTITY(-80)%UNITS= 'kW/m2'
OUTPUT_QUANTITY(-80)%SHORT_NAME = 'hrrpua_O2'

OUTPUT_QUANTITY(-81)%NAME = 'SOLID OXYGEN MASS FRACTION'
OUTPUT_QUANTITY(-81)%UNITS = 'kg/kg'
OUTPUT_QUANTITY(-81)%SHORT_NAME = 'Y_O2'
OUTPUT_QUANTITY(-81)%MATL_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(-81)%INSIDE_SOLID = .TRUE.
OUTPUT_QUANTITY(-81)%BNDF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(-81)%PROF_APPROPRIATE = .TRUE.

OUTPUT_QUANTITY(-82)%NAME = 'BLOWING CORRECTION'
OUTPUT_QUANTITY(-82)%UNITS= ''
OUTPUT_QUANTITY(-82)%SHORT_NAME = 'bcor'

! Fire spread
OUTPUT_QUANTITY(-90)%NAME = 'FIRE ARRIVAL TIME'
OUTPUT_QUANTITY(-90)%UNITS = 's'
OUTPUT_QUANTITY(-90)%SHORT_NAME = 't_a'
OUTPUT_QUANTITY(-90)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(-90)%AMBIENT_VALUE = 1.E6_EB

OUTPUT_QUANTITY(-91)%NAME = 'FIRE RESIDENCE TIME'
OUTPUT_QUANTITY(-91)%UNITS = 's'
OUTPUT_QUANTITY(-91)%SHORT_NAME = 't_r'
OUTPUT_QUANTITY(-91)%PART_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-92)%NAME = 'LS SPREAD RATE'
OUTPUT_QUANTITY(-92)%UNITS = 'm/s'
OUTPUT_QUANTITY(-92)%SHORT_NAME = 'r'
OUTPUT_QUANTITY(-92)%PART_APPROPRIATE = .FALSE.

! Condensation
OUTPUT_QUANTITY(-100)%NAME = 'CONDENSATION HEAT FLUX'
OUTPUT_QUANTITY(-100)%UNITS= 'kW/m2'
OUTPUT_QUANTITY(-100)%SHORT_NAME = 'q_cndns'
OUTPUT_QUANTITY(-100)%SPEC_ID_REQUIRED = .FALSE.
OUTPUT_QUANTITY(-100)%BNDF_APPROPRIATE = .TRUE.

END SUBROUTINE DEFINE_OUTPUT_QUANTITIES


SUBROUTINE SET_QUANTITIES_AMBIENT
USE GLOBAL_CONSTANTS, ONLY: RHOA,TMPA,TMPM
! Define OUTPUT_QUANTITYs that have fixed names

OUTPUT_QUANTITY(1)%AMBIENT_VALUE = RHOA
OUTPUT_QUANTITY(5)%AMBIENT_VALUE = TMPA-TMPM
OUTPUT_QUANTITY(110)%AMBIENT_VALUE = TMPA-TMPM
OUTPUT_QUANTITY(-6:-4)%AMBIENT_VALUE = TMPA-TMPM
OUTPUT_QUANTITY(-12)%AMBIENT_VALUE = TMPA-TMPM
OUTPUT_QUANTITY(-23)%AMBIENT_VALUE = TMPA-TMPM

END SUBROUTINE SET_QUANTITIES_AMBIENT


SUBROUTINE COLOR2RGB(RGB,COLOR)
USE COMP_FUNCTIONS, ONLY:SHUTDOWN
! Translate character string of a color name to RGB value

INTEGER, INTENT(OUT) :: RGB(3)
CHARACTER(25), INTENT(IN) :: COLOR
CHARACTER(MESSAGE_LENGTH) :: MESSAGE
REAL :: RAN_NUM
INTEGER :: IC

SELECT CASE(COLOR)
CASE ('ALICE BLUE');RGB = (/240,248,255/)
CASE ('ANTIQUE WHITE');RGB = (/250,235,215/)
CASE ('ANTIQUE WHITE 1');RGB = (/255,239,219/)
CASE ('ANTIQUE WHITE 2');RGB = (/238,223,204/)
CASE ('ANTIQUE WHITE 3');RGB = (/205,192,176/)
CASE ('ANTIQUE WHITE 4');RGB = (/139,131,120/)
CASE ('AQUAMARINE');RGB = (/127,255,212/)
CASE ('AQUAMARINE 1');RGB = (/118,238,198/)
CASE ('AQUAMARINE 2');RGB = (/102,205,170/)
CASE ('AQUAMARINE 3');RGB = (/69,139,116/)
CASE ('AZURE');RGB = (/240,255,255/)
CASE ('AZURE 1');RGB = (/224,238,238/)
CASE ('AZURE 2');RGB = (/193,205,205/)
CASE ('AZURE 3');RGB = (/131,139,139/)
CASE ('BANANA');RGB = (/227,207,87/)
CASE ('BEIGE');RGB = (/245,245,220/)
CASE ('BISQUE');RGB = (/255,228,196/)
CASE ('BISQUE 1');RGB = (/238,213,183/)
CASE ('BISQUE 2');RGB = (/205,183,158/)
CASE ('BISQUE 3');RGB = (/139,125,107/)
CASE ('BLACK');RGB = (/0,0,0/)
CASE ('BLANCHED ALMOND');RGB = (/255,235,205/)
CASE ('BLUE');RGB = (/0,0,255/)
CASE ('BLUE 2');RGB = (/0,0,238/)
CASE ('BLUE 3');RGB = (/0,0,205/)
CASE ('BLUE 4');RGB = (/0,0,139/)
CASE ('BLUE VIOLET');RGB = (/138,43,226/)
CASE ('BRICK');RGB = (/156,102,31/)
CASE ('BROWN');RGB = (/165,42,42/)
CASE ('BROWN 1');RGB = (/255,64,64/)
CASE ('BROWN 2');RGB = (/238,59,59/)
CASE ('BROWN 3');RGB = (/205,51,51/)
CASE ('BROWN 4');RGB = (/139,35,35/)
CASE ('BURLY WOOD');RGB = (/222,184,135/)
CASE ('BURLY WOOD 1');RGB = (/255,211,155/)
CASE ('BURLY WOOD 2');RGB = (/238,197,145/)
CASE ('BURLY WOOD 3');RGB = (/205,170,125/)
CASE ('BURLY WOOD 4');RGB = (/139,115,85/)
CASE ('BURNT ORANGE');RGB = (/204,85,0/)
CASE ('BURNT SIENNA');RGB = (/138,54,15/)
CASE ('BURNT UMBER');RGB = (/138,51,36/)
CASE ('CADET BLUE');RGB = (/95,158,160/)
CASE ('CADET BLUE 1');RGB = (/152,245,255/)
CASE ('CADET BLUE 2');RGB = (/142,229,238/)
CASE ('CADET BLUE 3');RGB = (/122,197,205/)
CASE ('CADET BLUE 4');RGB = (/83,134,139/)
CASE ('CADMIUM ORANGE');RGB = (/255,97,3/)
CASE ('CADMIUM YELLOW');RGB = (/255,153,18/)
CASE ('CARROT');RGB = (/237,145,33/)
CASE ('CHARTREUSE');RGB = (/127,255,0/)
CASE ('CHARTREUSE 1');RGB = (/118,238,0/)
CASE ('CHARTREUSE 2');RGB = (/102,205,0/)
CASE ('CHARTREUSE 3');RGB = (/69,139,0/)
CASE ('CHOCOLATE');RGB = (/210,105,30/)
CASE ('CHOCOLATE 1');RGB = (/255,127,36/)
CASE ('CHOCOLATE 2');RGB = (/238,118,33/)
CASE ('CHOCOLATE 3');RGB = (/205,102,29/)
CASE ('CHOCOLATE 4');RGB = (/139,69,19/)
CASE ('COBALT');RGB = (/61,89,171/)
CASE ('COBALT GREEN');RGB = (/61,145,64/)
CASE ('COLD GREY');RGB = (/128,138,135/)
CASE ('CORAL');RGB = (/255,127,80/)
CASE ('CORAL 1');RGB = (/255,114,86/)
CASE ('CORAL 2');RGB = (/238,106,80/)
CASE ('CORAL 3');RGB = (/205,91,69/)
CASE ('CORAL 4');RGB = (/139,62,47/)
CASE ('CORNFLOWER BLUE');RGB = (/100,149,237/)
CASE ('CORNSILK');RGB = (/255,248,220/)
CASE ('CORNSILK 1');RGB = (/238,232,205/)
CASE ('CORNSILK 2');RGB = (/205,200,177/)
CASE ('CORNSILK 3');RGB = (/139,136,120/)
CASE ('CRIMSON');RGB = (/220,20,60/)
CASE ('CYAN');RGB = (/0,255,255/)
CASE ('CYAN 2');RGB = (/0,238,238/)
CASE ('CYAN 3');RGB = (/0,205,205/)
CASE ('CYAN 4');RGB = (/0,139,139/)
CASE ('DARK GOLDENROD');RGB = (/184,134,11/)
CASE ('DARK GOLDENROD 1');RGB = (/255,185,15/)
CASE ('DARK GOLDENROD 2');RGB = (/238,173,14/)
CASE ('DARK GOLDENROD 3');RGB = (/205,149,12/)
CASE ('DARK GOLDENROD 4');RGB = (/139,101,8/)
CASE ('DARK GRAY');RGB = (/169,169,169/)
CASE ('DARK GREEN');RGB = (/0,100,0/)
CASE ('DARK KHAKI');RGB = (/189,183,107/)
CASE ('DARK OLIVE GREEN');RGB = (/85,107,47/)
CASE ('DARK OLIVE GREEN 1');RGB = (/202,255,112/)
CASE ('DARK OLIVE GREEN 2');RGB = (/188,238,104/)
CASE ('DARK OLIVE GREEN 3');RGB = (/162,205,90/)
CASE ('DARK OLIVE GREEN 4');RGB = (/110,139,61/)
CASE ('DARK ORANGE');RGB = (/255,140,0/)
CASE ('DARK ORANGE 1');RGB = (/255,127,0/)
CASE ('DARK ORANGE 2');RGB = (/238,118,0/)
CASE ('DARK ORANGE 3');RGB = (/205,102,0/)
CASE ('DARK ORANGE 4');RGB = (/139,69,0/)
CASE ('DARK ORCHID');RGB = (/153,50,204/)
CASE ('DARK ORCHID 1');RGB = (/191,62,255/)
CASE ('DARK ORCHID 2');RGB = (/178,58,238/)
CASE ('DARK ORCHID 3');RGB = (/154,50,205/)
CASE ('DARK ORCHID 4');RGB = (/104,34,139/)
CASE ('DARK SALMON');RGB = (/233,150,122/)
CASE ('DARK SEA GREEN');RGB = (/143,188,143/)
CASE ('DARK SEA GREEN 1');RGB = (/193,255,193/)
CASE ('DARK SEA GREEN 2');RGB = (/180,238,180/)
CASE ('DARK SEA GREEN 3');RGB = (/155,205,155/)
CASE ('DARK SEA GREEN 4');RGB = (/105,139,105/)
CASE ('DARK SLATE BLUE');RGB = (/72,61,139/)
CASE ('DARK SLATE GRAY');RGB = (/47,79,79/)
CASE ('DARK SLATE GRAY 1');RGB = (/151,255,255/)
CASE ('DARK SLATE GRAY 2');RGB = (/141,238,238/)
CASE ('DARK SLATE GRAY 3');RGB = (/121,205,205/)
CASE ('DARK SLATE GRAY 4');RGB = (/82,139,139/)
CASE ('DARK TURQUOISE');RGB = (/0,206,209/)
CASE ('DARK VIOLET');RGB = (/148,0,211/)
CASE ('DEEP PINK');RGB = (/255,20,147/)
CASE ('DEEP PINK 1');RGB = (/238,18,137/)
CASE ('DEEP PINK 2');RGB = (/205,16,118/)
CASE ('DEEP PINK 3');RGB = (/139,10,80/)
CASE ('DEEP SKYBLUE');RGB = (/0,191,255/)
CASE ('DEEP SKYBLUE 1');RGB = (/0,178,238/)
CASE ('DEEP SKYBLUE 2');RGB = (/0,154,205/)
CASE ('DEEP SKYBLUE 3');RGB = (/0,104,139/)
CASE ('DIM GRAY');RGB = (/105,105,105/)
CASE ('DODGERBLUE');RGB = (/30,144,255/)
CASE ('DODGERBLUE 1');RGB = (/28,134,238/)
CASE ('DODGERBLUE 2');RGB = (/24,116,205/)
CASE ('DODGERBLUE 3');RGB = (/16,78,139/)
CASE ('EGGSHELL');RGB = (/252,230,201/)
CASE ('EMERALD GREEN');RGB = (/0,201,87/)
CASE ('FIREBRICK');RGB = (/178,34,34/)
CASE ('FIREBRICK 1');RGB = (/255,48,48/)
CASE ('FIREBRICK 2');RGB = (/238,44,44/)
CASE ('FIREBRICK 3');RGB = (/205,38,38/)
CASE ('FIREBRICK 4');RGB = (/139,26,26/)
CASE ('FLESH');RGB = (/255,125,64/)
CASE ('FLORAL WHITE');RGB = (/255,250,240/)
CASE ('FOREST GREEN');RGB = (/34,139,34/)
CASE ('GAINSBORO');RGB = (/220,220,220/)
CASE ('GHOST WHITE');RGB = (/248,248,255/)
CASE ('GOLD');RGB = (/255,215,0/)
CASE ('GOLD 1');RGB = (/238,201,0/)
CASE ('GOLD 2');RGB = (/205,173,0/)
CASE ('GOLD 3');RGB = (/139,117,0/)
CASE ('GOLDENROD');RGB = (/218,165,32/)
CASE ('GOLDENROD 1');RGB = (/255,193,37/)
CASE ('GOLDENROD 2');RGB = (/238,180,34/)
CASE ('GOLDENROD 3');RGB = (/205,155,29/)
CASE ('GOLDENROD 4');RGB = (/139,105,20/)
CASE ('GRAY');RGB = (/128,128,128/)
CASE ('GRAY 1');RGB = (/3,3,3/)
CASE ('GRAY 10');RGB = (/26,26,26/)
CASE ('GRAY 11');RGB = (/28,28,28/)
CASE ('GRAY 12');RGB = (/31,31,31/)
CASE ('GRAY 13');RGB = (/33,33,33/)
CASE ('GRAY 14');RGB = (/36,36,36/)
CASE ('GRAY 15');RGB = (/38,38,38/)
CASE ('GRAY 16');RGB = (/41,41,41/)
CASE ('GRAY 17');RGB = (/43,43,43/)
CASE ('GRAY 18');RGB = (/46,46,46/)
CASE ('GRAY 19');RGB = (/48,48,48/)
CASE ('GRAY 2');RGB = (/5,5,5/)
CASE ('GRAY 20');RGB = (/51,51,51/)
CASE ('GRAY 21');RGB = (/54,54,54/)
CASE ('GRAY 22');RGB = (/56,56,56/)
CASE ('GRAY 23');RGB = (/59,59,59/)
CASE ('GRAY 24');RGB = (/61,61,61/)
CASE ('GRAY 25');RGB = (/64,64,64/)
CASE ('GRAY 26');RGB = (/66,66,66/)
CASE ('GRAY 27');RGB = (/69,69,69/)
CASE ('GRAY 28');RGB = (/71,71,71/)
CASE ('GRAY 29');RGB = (/74,74,74/)
CASE ('GRAY 3');RGB = (/8,8,8/)
CASE ('GRAY 30');RGB = (/77,77,77/)
CASE ('GRAY 31');RGB = (/79,79,79/)
CASE ('GRAY 32');RGB = (/82,82,82/)
CASE ('GRAY 33');RGB = (/84,84,84/)
CASE ('GRAY 34');RGB = (/87,87,87/)
CASE ('GRAY 35');RGB = (/89,89,89/)
CASE ('GRAY 36');RGB = (/92,92,92/)
CASE ('GRAY 37');RGB = (/94,94,94/)
CASE ('GRAY 38');RGB = (/97,97,97/)
CASE ('GRAY 39');RGB = (/99,99,99/)
CASE ('GRAY 4');RGB = (/10,10,10/)
CASE ('GRAY 40');RGB = (/102,102,102/)
CASE ('GRAY 42');RGB = (/107,107,107/)
CASE ('GRAY 43');RGB = (/110,110,110/)
CASE ('GRAY 44');RGB = (/112,112,112/)
CASE ('GRAY 45');RGB = (/115,115,115/)
CASE ('GRAY 46');RGB = (/117,117,117/)
CASE ('GRAY 47');RGB = (/120,120,120/)
CASE ('GRAY 48');RGB = (/122,122,122/)
CASE ('GRAY 49');RGB = (/125,125,125/)
CASE ('GRAY 5');RGB = (/13,13,13/)
CASE ('GRAY 50');RGB = (/127,127,127/)
CASE ('GRAY 51');RGB = (/130,130,130/)
CASE ('GRAY 52');RGB = (/133,133,133/)
CASE ('GRAY 53');RGB = (/135,135,135/)
CASE ('GRAY 54');RGB = (/138,138,138/)
CASE ('GRAY 55');RGB = (/140,140,140/)
CASE ('GRAY 56');RGB = (/143,143,143/)
CASE ('GRAY 57');RGB = (/145,145,145/)
CASE ('GRAY 58');RGB = (/148,148,148/)
CASE ('GRAY 59');RGB = (/150,150,150/)
CASE ('GRAY 6');RGB = (/15,15,15/)
CASE ('GRAY 60');RGB = (/153,153,153/)
CASE ('GRAY 61');RGB = (/156,156,156/)
CASE ('GRAY 62');RGB = (/158,158,158/)
CASE ('GRAY 63');RGB = (/161,161,161/)
CASE ('GRAY 64');RGB = (/163,163,163/)
CASE ('GRAY 65');RGB = (/166,166,166/)
CASE ('GRAY 66');RGB = (/168,168,168/)
CASE ('GRAY 67');RGB = (/171,171,171/)
CASE ('GRAY 68');RGB = (/173,173,173/)
CASE ('GRAY 69');RGB = (/176,176,176/)
CASE ('GRAY 7');RGB = (/18,18,18/)
CASE ('GRAY 70');RGB = (/179,179,179/)
CASE ('GRAY 71');RGB = (/181,181,181/)
CASE ('GRAY 72');RGB = (/184,184,184/)
CASE ('GRAY 73');RGB = (/186,186,186/)
CASE ('GRAY 74');RGB = (/189,189,189/)
CASE ('GRAY 75');RGB = (/191,191,191/)
CASE ('GRAY 76');RGB = (/194,194,194/)
CASE ('GRAY 77');RGB = (/196,196,196/)
CASE ('GRAY 78');RGB = (/199,199,199/)
CASE ('GRAY 79');RGB = (/201,201,201/)
CASE ('GRAY 8');RGB = (/20,20,20/)
CASE ('GRAY 80');RGB = (/204,204,204/)
CASE ('GRAY 81');RGB = (/207,207,207/)
CASE ('GRAY 82');RGB = (/209,209,209/)
CASE ('GRAY 83');RGB = (/212,212,212/)
CASE ('GRAY 84');RGB = (/214,214,214/)
CASE ('GRAY 85');RGB = (/217,217,217/)
CASE ('GRAY 86');RGB = (/219,219,219/)
CASE ('GRAY 87');RGB = (/222,222,222/)
CASE ('GRAY 88');RGB = (/224,224,224/)
CASE ('GRAY 89');RGB = (/227,227,227/)
CASE ('GRAY 9');RGB = (/23,23,23/)
CASE ('GRAY 90');RGB = (/229,229,229/)
CASE ('GRAY 91');RGB = (/232,232,232/)
CASE ('GRAY 92');RGB = (/235,235,235/)
CASE ('GRAY 93');RGB = (/237,237,237/)
CASE ('GRAY 94');RGB = (/240,240,240/)
CASE ('GRAY 95');RGB = (/242,242,242/)
CASE ('GRAY 97');RGB = (/247,247,247/)
CASE ('GRAY 98');RGB = (/250,250,250/)
CASE ('GRAY 99');RGB = (/252,252,252/)
CASE ('GREEN');RGB = (/0,255,0/)
CASE ('GREEN 2');RGB = (/0,238,0/)
CASE ('GREEN 3');RGB = (/0,205,0/)
CASE ('GREEN 4');RGB = (/0,139,0/)
CASE ('GREEN YELLOW');RGB = (/173,255,47/)
CASE ('HONEYDEW');RGB = (/240,255,240/)
CASE ('HONEYDEW 1');RGB = (/224,238,224/)
CASE ('HONEYDEW 2');RGB = (/193,205,193/)
CASE ('HONEYDEW 3');RGB = (/131,139,131/)
CASE ('HOT PINK');RGB = (/255,105,180/)
CASE ('HOT PINK 1');RGB = (/255,110,180/)
CASE ('HOT PINK 2');RGB = (/238,106,167/)
CASE ('HOT PINK 3');RGB = (/205,96,144/)
CASE ('HOT PINK 4');RGB = (/139,58,98/)
CASE ('INDIAN RED');RGB = (/205,92,92/)
CASE ('INDIAN RED 1');RGB = (/255,106,106/)
CASE ('INDIAN RED 2');RGB = (/238,99,99/)
CASE ('INDIAN RED 3');RGB = (/205,85,85/)
CASE ('INDIAN RED 4');RGB = (/139,58,58/)
CASE ('INDIGO');RGB = (/75,0,130/)
CASE ('IVORY');RGB = (/255,255,240/)
CASE ('IVORY 1');RGB = (/238,238,224/)
CASE ('IVORY 2');RGB = (/205,205,193/)
CASE ('IVORY 3');RGB = (/139,139,131/)
CASE ('IVORY BLACK');RGB = (/41,36,33/)
CASE ('KELLY GREEN');RGB = (/0,128,0/)
CASE ('KHAKI');RGB = (/240,230,140/)
CASE ('KHAKI 1');RGB = (/255,246,143/)
CASE ('KHAKI 2');RGB = (/238,230,133/)
CASE ('KHAKI 3');RGB = (/205,198,115/)
CASE ('KHAKI 4');RGB = (/139,134,78/)
CASE ('LAVENDER');RGB = (/230,230,250/)
CASE ('LAVENDER BLUSH');RGB = (/255,240,245/)
CASE ('LAVENDER BLUSH 1');RGB = (/238,224,229/)
CASE ('LAVENDER BLUSH 2');RGB = (/205,193,197/)
CASE ('LAVENDER BLUSH 3');RGB = (/139,131,134/)
CASE ('LAWN GREEN');RGB = (/124,252,0/)
CASE ('LEMON CHIFFON');RGB = (/255,250,205/)
CASE ('LEMON CHIFFON 1');RGB = (/238,233,191/)
CASE ('LEMON CHIFFON 2');RGB = (/205,201,165/)
CASE ('LEMON CHIFFON 3');RGB = (/139,137,112/)
CASE ('LIGHT BLUE');RGB = (/173,216,230/)
CASE ('LIGHT BLUE 1');RGB = (/191,239,255/)
CASE ('LIGHT BLUE 2');RGB = (/178,223,238/)
CASE ('LIGHT BLUE 3');RGB = (/154,192,205/)
CASE ('LIGHT BLUE 4');RGB = (/104,131,139/)
CASE ('LIGHT BLUE 5');RGB = (/185,217,235/)
CASE ('LIGHT CORAL');RGB = (/240,128,128/)
CASE ('LIGHT CYAN');RGB = (/224,255,255/)
CASE ('LIGHT CYAN 1');RGB = (/209,238,238/)
CASE ('LIGHT CYAN 2');RGB = (/180,205,205/)
CASE ('LIGHT CYAN 3');RGB = (/122,139,139/)
CASE ('LIGHT GOLDENROD');RGB = (/255,236,139/)
CASE ('LIGHT GOLDENROD 1');RGB = (/238,220,130/)
CASE ('LIGHT GOLDENROD 2');RGB = (/205,190,112/)
CASE ('LIGHT GOLDENROD 3');RGB = (/139,129,76/)
CASE ('LIGHT GOLDENROD YELLOW');RGB = (/250,250,210/)
CASE ('LIGHT GREY');RGB = (/211,211,211/)
CASE ('LIGHT PINK');RGB = (/255,182,193/)
CASE ('LIGHT PINK 1');RGB = (/255,174,185/)
CASE ('LIGHT PINK 2');RGB = (/238,162,173/)
CASE ('LIGHT PINK 3');RGB = (/205,140,149/)
CASE ('LIGHT PINK 4');RGB = (/139,95,101/)
CASE ('LIGHT SALMON');RGB = (/255,160,122/)
CASE ('LIGHT SALMON 1');RGB = (/238,149,114/)
CASE ('LIGHT SALMON 2');RGB = (/205,129,98/)
CASE ('LIGHT SALMON 3');RGB = (/139,87,66/)
CASE ('LIGHT SEA GREEN');RGB = (/32,178,170/)
CASE ('LIGHT SKY BLUE');RGB = (/135,206,250/)
CASE ('LIGHT SKY BLUE 1');RGB = (/176,226,255/)
CASE ('LIGHT SKY BLUE 2');RGB = (/164,211,238/)
CASE ('LIGHT SKY BLUE 3');RGB = (/141,182,205/)
CASE ('LIGHT SKY BLUE 4');RGB = (/96,123,139/)
CASE ('LIGHT SLATE BLUE');RGB = (/132,112,255/)
CASE ('LIGHT SLATE GRAY');RGB = (/119,136,153/)
CASE ('LIGHT STEEL BLUE');RGB = (/176,196,222/)
CASE ('LIGHT STEEL BLUE 1');RGB = (/202,225,255/)
CASE ('LIGHT STEEL BLUE 2');RGB = (/188,210,238/)
CASE ('LIGHT STEEL BLUE 3');RGB = (/162,181,205/)
CASE ('LIGHT STEEL BLUE 4');RGB = (/110,123,139/)
CASE ('LIGHT YELLOW 1');RGB = (/255,255,224/)
CASE ('LIGHT YELLOW 2');RGB = (/238,238,209/)
CASE ('LIGHT YELLOW 3');RGB = (/205,205,180/)
CASE ('LIGHT YELLOW 4');RGB = (/139,139,122/)
CASE ('LIME GREEN');RGB = (/50,205,50/)
CASE ('LINEN');RGB = (/250,240,230/)
CASE ('MAGENTA');RGB = (/255,0,255/)
CASE ('MAGENTA 2');RGB = (/238,0,238/)
CASE ('MAGENTA 3');RGB = (/205,0,205/)
CASE ('MAGENTA 4');RGB = (/139,0,139/)
CASE ('MANGANESE BLUE');RGB = (/3,168,158/)
CASE ('MAROON');RGB = (/128,0,0/)
CASE ('MAROON 1');RGB = (/255,52,179/)
CASE ('MAROON 2');RGB = (/238,48,167/)
CASE ('MAROON 3');RGB = (/205,41,144/)
CASE ('MAROON 4');RGB = (/139,28,98/)
CASE ('MEDIUM ORCHID');RGB = (/186,85,211/)
CASE ('MEDIUM ORCHID 1');RGB = (/224,102,255/)
CASE ('MEDIUM ORCHID 2');RGB = (/209,95,238/)
CASE ('MEDIUM ORCHID 3');RGB = (/180,82,205/)
CASE ('MEDIUM ORCHID 4');RGB = (/122,55,139/)
CASE ('MEDIUM PURPLE');RGB = (/147,112,219/)
CASE ('MEDIUM PURPLE 1');RGB = (/171,130,255/)
CASE ('MEDIUM PURPLE 2');RGB = (/159,121,238/)
CASE ('MEDIUM PURPLE 3');RGB = (/137,104,205/)
CASE ('MEDIUM PURPLE 4');RGB = (/93,71,139/)
CASE ('MEDIUM SEA GREEN');RGB = (/60,179,113/)
CASE ('MEDIUM SLATE BLUE');RGB = (/123,104,238/)
CASE ('MEDIUM SPRING GREEN');RGB = (/0,250,154/)
CASE ('MEDIUM TURQUOISE');RGB = (/72,209,204/)
CASE ('MEDIUM VIOLET RED');RGB = (/199,21,133/)
CASE ('MELON');RGB = (/227,168,105/)
CASE ('MIDNIGHT BLUE');RGB = (/25,25,112/)
CASE ('MINT');RGB = (/189,252,201/)
CASE ('MINT CREAM');RGB = (/245,255,250/)
CASE ('MISTY ROSE');RGB = (/255,228,225/)
CASE ('MISTY ROSE 1');RGB = (/238,213,210/)
CASE ('MISTY ROSE 2');RGB = (/205,183,181/)
CASE ('MISTY ROSE 3');RGB = (/139,125,123/)
CASE ('MOCCASIN');RGB = (/255,228,181/)
CASE ('NAVAJO WHITE');RGB = (/255,222,173/)
CASE ('NAVAJO WHITE 1');RGB = (/238,207,161/)
CASE ('NAVAJO WHITE 2');RGB = (/205,179,139/)
CASE ('NAVAJO WHITE 3');RGB = (/139,121,94/)
CASE ('NAVY');RGB = (/0,0,128/)
CASE ('OLD LACE');RGB = (/253,245,230/)
CASE ('OLIVE');RGB = (/128,128,0/)
CASE ('OLIVE DRAB');RGB = (/192,255,62/)
CASE ('OLIVE DRAB 1');RGB = (/179,238,58/)
CASE ('OLIVE DRAB 2');RGB = (/154,205,50/)
CASE ('OLIVE DRAB 3');RGB = (/105,139,34/)
CASE ('ORANGE');RGB = (/255,128,0/)
CASE ('ORANGE 1');RGB = (/255,165,0/)
CASE ('ORANGE 2');RGB = (/238,154,0/)
CASE ('ORANGE 3');RGB = (/205,133,0/)
CASE ('ORANGE 4');RGB = (/139,90,0/)
CASE ('ORANGE 5');RGB = (/245,102,0/)
CASE ('ORANGE RED');RGB = (/255,69,0/)
CASE ('ORANGE RED 1');RGB = (/238,64,0/)
CASE ('ORANGE RED 2');RGB = (/205,55,0/)
CASE ('ORANGE RED 3');RGB = (/139,37,0/)
CASE ('ORCHID');RGB = (/218,112,214/)
CASE ('ORCHID 1');RGB = (/255,131,250/)
CASE ('ORCHID 2');RGB = (/238,122,233/)
CASE ('ORCHID 3');RGB = (/205,105,201/)
CASE ('ORCHID 4');RGB = (/139,71,137/)
CASE ('PALE GOLDENROD');RGB = (/238,232,170/)
CASE ('PALE GREEN');RGB = (/152,251,152/)
CASE ('PALE GREEN 1');RGB = (/154,255,154/)
CASE ('PALE GREEN 2');RGB = (/144,238,144/)
CASE ('PALE GREEN 3');RGB = (/124,205,124/)
CASE ('PALE GREEN 4');RGB = (/84,139,84/)
CASE ('PALE TURQUOISE');RGB = (/187,255,255/)
CASE ('PALE TURQUOISE 1');RGB = (/174,238,238/)
CASE ('PALE TURQUOISE 2');RGB = (/150,205,205/)
CASE ('PALE TURQUOISE 3');RGB = (/102,139,139/)
CASE ('PALE VIOLET RED');RGB = (/219,112,147/)
CASE ('PALE VIOLET RED 1');RGB = (/255,130,171/)
CASE ('PALE VIOLET RED 2');RGB = (/238,121,159/)
CASE ('PALE VIOLET RED 3');RGB = (/205,104,137/)
CASE ('PALE VIOLET RED 4');RGB = (/139,71,93/)
CASE ('PAPAYA WHIP');RGB = (/255,239,213/)
CASE ('PEACH PUFF');RGB = (/255,218,185/)
CASE ('PEACH PUFF 1');RGB = (/238,203,173/)
CASE ('PEACH PUFF 2');RGB = (/205,175,149/)
CASE ('PEACH PUFF 3');RGB = (/139,119,101/)
CASE ('PEACOCK');RGB = (/51,161,201/)
CASE ('PINK');RGB = (/255,192,203/)
CASE ('PINK 1');RGB = (/255,181,197/)
CASE ('PINK 2');RGB = (/238,169,184/)
CASE ('PINK 3');RGB = (/205,145,158/)
CASE ('PINK 4');RGB = (/139,99,108/)
CASE ('PLUM');RGB = (/221,160,221/)
CASE ('PLUM 1');RGB = (/255,187,255/)
CASE ('PLUM 2');RGB = (/238,174,238/)
CASE ('PLUM 3');RGB = (/205,150,205/)
CASE ('PLUM 4');RGB = (/139,102,139/)
CASE ('POWDER BLUE');RGB = (/176,224,230/)
CASE ('PURPLE');RGB = (/128,0,128/)
CASE ('PURPLE 1');RGB = (/155,48,255/)
CASE ('PURPLE 2');RGB = (/145,44,238/)
CASE ('PURPLE 3');RGB = (/125,38,205/)
CASE ('PURPLE 4');RGB = (/85,26,139/)
CASE ('RAINBOW')
   DO IC=1,3
      CALL RANDOM_NUMBER(RAN_NUM)
      RGB(IC) = INT(RAN_NUM*255._EB)
   ENDDO
CASE ('RASPBERRY');RGB = (/135,38,87/)
CASE ('RAW SIENNA');RGB = (/199,97,20/)
CASE ('RED');RGB = (/255,0,0/)
CASE ('RED 1');RGB = (/238,0,0/)
CASE ('RED 2');RGB = (/205,0,0/)
CASE ('RED 3');RGB = (/139,0,0/)
CASE ('ROSY BROWN');RGB = (/188,143,143/)
CASE ('ROSY BROWN 1');RGB = (/255,193,193/)
CASE ('ROSY BROWN 2');RGB = (/238,180,180/)
CASE ('ROSY BROWN 3');RGB = (/205,155,155/)
CASE ('ROSY BROWN 4');RGB = (/139,105,105/)
CASE ('ROYAL BLUE');RGB = (/65,105,225/)
CASE ('ROYAL BLUE 1');RGB = (/72,118,255/)
CASE ('ROYAL BLUE 2');RGB = (/67,110,238/)
CASE ('ROYAL BLUE 3');RGB = (/58,95,205/)
CASE ('ROYAL BLUE 4');RGB = (/39,64,139/)
CASE ('SALMON');RGB = (/250,128,114/)
CASE ('SALMON 1');RGB = (/255,140,105/)
CASE ('SALMON 2');RGB = (/238,130,98/)
CASE ('SALMON 3');RGB = (/205,112,84/)
CASE ('SALMON 4');RGB = (/139,76,57/)
CASE ('SANDY BROWN');RGB = (/244,164,96/)
CASE ('SAP GREEN');RGB = (/48,128,20/)
CASE ('SEA GREEN');RGB = (/84,255,159/)
CASE ('SEA GREEN 1');RGB = (/78,238,148/)
CASE ('SEA GREEN 2');RGB = (/67,205,128/)
CASE ('SEA GREEN 3');RGB = (/46,139,87/)
CASE ('SEASHELL');RGB = (/255,245,238/)
CASE ('SEASHELL 1');RGB = (/238,229,222/)
CASE ('SEASHELL 2');RGB = (/205,197,191/)
CASE ('SEASHELL 3');RGB = (/139,134,130/)
CASE ('SEPIA');RGB = (/94,38,18/)
CASE ('SIENNA');RGB = (/160,82,45/)
CASE ('SIENNA 1');RGB = (/255,130,71/)
CASE ('SIENNA 2');RGB = (/238,121,66/)
CASE ('SIENNA 3');RGB = (/205,104,57/)
CASE ('SIENNA 4');RGB = (/139,71,38/)
CASE ('SILVER');RGB = (/192,192,192/)
CASE ('SKY BLUE');RGB = (/135,206,235/)
CASE ('SKY BLUE 1');RGB = (/135,206,255/)
CASE ('SKY BLUE 2');RGB = (/126,192,238/)
CASE ('SKY BLUE 3');RGB = (/108,166,205/)
CASE ('SKY BLUE 4');RGB = (/74,112,139/)
CASE ('SKY BLUE 5');RGB = (/46,154,240/)
CASE ('SLATE BLUE');RGB = (/106,90,205/)
CASE ('SLATE BLUE 1');RGB = (/131,111,255/)
CASE ('SLATE BLUE 2');RGB = (/122,103,238/)
CASE ('SLATE BLUE 3');RGB = (/105,89,205/)
CASE ('SLATE BLUE 4');RGB = (/71,60,139/)
CASE ('SLATE GRAY');RGB = (/112,128,144/)
CASE ('SLATE GRAY 1');RGB = (/198,226,255/)
CASE ('SLATE GRAY 2');RGB = (/185,211,238/)
CASE ('SLATE GRAY 3');RGB = (/159,182,205/)
CASE ('SLATE GRAY 4');RGB = (/108,123,139/)
CASE ('SNOW');RGB = (/255,250,250/)
CASE ('SNOW 1');RGB = (/238,233,233/)
CASE ('SNOW 2');RGB = (/205,201,201/)
CASE ('SNOW 3');RGB = (/139,137,137/)
CASE ('SPRING GREEN');RGB = (/0,255,127/)
CASE ('SPRING GREEN 1');RGB = (/0,238,118/)
CASE ('SPRING GREEN 2');RGB = (/0,205,102/)
CASE ('SPRING GREEN 3');RGB = (/0,139,69/)
CASE ('STEEL BLUE');RGB = (/70,130,180/)
CASE ('STEEL BLUE 1');RGB = (/99,184,255/)
CASE ('STEEL BLUE 2');RGB = (/92,172,238/)
CASE ('STEEL BLUE 3');RGB = (/79,148,205/)
CASE ('STEEL BLUE 4');RGB = (/54,100,139/)
CASE ('TAN');RGB = (/210,180,140/)
CASE ('TAN 1');RGB = (/255,165,79/)
CASE ('TAN 2');RGB = (/238,154,73/)
CASE ('TAN 3');RGB = (/205,133,63/)
CASE ('TAN 4');RGB = (/139,90,43/)
CASE ('TEAL');RGB = (/0,128,128/)
CASE ('THISTLE');RGB = (/216,191,216/)
CASE ('THISTLE 1');RGB = (/255,225,255/)
CASE ('THISTLE 2');RGB = (/238,210,238/)
CASE ('THISTLE 3');RGB = (/205,181,205/)
CASE ('THISTLE 4');RGB = (/139,123,139/)
CASE ('TOMATO');RGB = (/255,99,71/)
CASE ('TOMATO 1');RGB = (/238,92,66/)
CASE ('TOMATO 2');RGB = (/205,79,57/)
CASE ('TOMATO 3');RGB = (/139,54,38/)
CASE ('TURQUOISE');RGB = (/64,224,208/)
CASE ('TURQUOISE 1');RGB = (/0,245,255/)
CASE ('TURQUOISE 2');RGB = (/0,229,238/)
CASE ('TURQUOISE 3');RGB = (/0,197,205/)
CASE ('TURQUOISE 4');RGB = (/0,134,139/)
CASE ('TURQUOISE BLUE');RGB = (/0,199,140/)
CASE ('VIOLET');RGB = (/238,130,238/)
CASE ('VIOLET RED');RGB = (/208,32,144/)
CASE ('VIOLET RED 1');RGB = (/255,62,150/)
CASE ('VIOLET RED 2');RGB = (/238,58,140/)
CASE ('VIOLET RED 3');RGB = (/205,50,120/)
CASE ('VIOLET RED 4');RGB = (/139,34,82/)
CASE ('WARM GREY');RGB = (/128,128,105/)
CASE ('WHEAT');RGB = (/245,222,179/)
CASE ('WHEAT 1');RGB = (/255,231,186/)
CASE ('WHEAT 2');RGB = (/238,216,174/)
CASE ('WHEAT 3');RGB = (/205,186,150/)
CASE ('WHEAT 4');RGB = (/139,126,102/)
CASE ('WHITE');RGB = (/255,255,255/)
CASE ('WHITE SMOKE');RGB = (/245,245,245/)
CASE ('YELLOW');RGB = (/255,255,0/)
CASE ('YELLOW 1');RGB = (/238,238,0/)
CASE ('YELLOW 2');RGB = (/205,205,0/)
CASE ('YELLOW 3');RGB = (/139,139,0/)

CASE DEFAULT
   WRITE(MESSAGE,'(A,A,A)') "ERROR: The COLOR, ", TRIM(COLOR),", is not a defined color"
   CALL SHUTDOWN(MESSAGE)
END SELECT

END SUBROUTINE COLOR2RGB


END MODULE OUTPUT_DATA


MODULE PROPERTY_DATA
USE PRECISION_PARAMETERS
USE THERMO_PROPS
IMPLICIT NONE (TYPE,EXTERNAL)

TYPE ELEMENT_TYPE
   CHARACTER(3):: ABBREVIATION
   CHARACTER(20):: NAME
   REAL(EB) :: MASS
END TYPE ELEMENT_TYPE

TYPE(ELEMENT_TYPE):: ELEMENT(118)

CONTAINS

SUBROUTINE THERMO_TABLE_GAS(I_TMP,CP,SPEC_INDEX,SS_INDEX,RCON,G_F)

USE GLOBAL_CONSTANTS, ONLY: GAMMA,CONSTANT_SPECIFIC_HEAT_RATIO,R0
USE TYPES, ONLY : SPECIES
INTEGER,INTENT(IN) ::SPEC_INDEX, SS_INDEX, I_TMP
REAL(EB),INTENT(IN) :: RCON
REAL(EB),INTENT(OUT) :: CP,G_F
REAL(EB) :: TE,H,S,TB(4),A(7,3),BC(2,3)
INTEGER :: B,BANDS
CHARACTER(LABEL_LENGTH):: POLY
TYPE (THERMO_DATA_TYPE), POINTER :: TD

G_F = 0._EB !kJ/mol
IF (SPEC_INDEX==-1 .OR. CONSTANT_SPECIFIC_HEAT_RATIO) THEN
   IF (SS_INDEX >= 0) THEN
      IF (SPECIES(SS_INDEX)%POLYNOMIAL=='null') THEN
         CP = RCON*GAMMA/(GAMMA-1._EB) !J/kg/K
         RETURN
      ENDIF
   ENDIF
ENDIF

POLY='null'

IF (SS_INDEX>0) THEN
   IF (SPECIES(SS_INDEX)%POLYNOMIAL/='null') THEN
      POLY = SPECIES(SS_INDEX)%POLYNOMIAL
      BANDS = SPECIES(SS_INDEX)%POLYNOMIAL_BANDS
      TB = SPECIES(SS_INDEX)%POLYNOMIAL_TEMP
      IF (SPECIES(SS_INDEX)%POLYNOMIAL=='NASA7') THEN
         BC(1,1:BANDS) = SPECIES(SS_INDEX)%POLYNOMIAL_COEFF(6,1:BANDS)
         BC(2,1:BANDS) = SPECIES(SS_INDEX)%POLYNOMIAL_COEFF(7,1:BANDS)
         DO B=1,BANDS
            A(1:5,B) = SPECIES(SS_INDEX)%POLYNOMIAL_COEFF(1:5,B)
         ENDDO
      ELSE
         BC(1,1:BANDS) = SPECIES(SS_INDEX)%POLYNOMIAL_COEFF(8,1:BANDS)
         BC(2,1:BANDS) = SPECIES(SS_INDEX)%POLYNOMIAL_COEFF(9,1:BANDS)
         DO B=1,BANDS
            A(1:7,B) = SPECIES(SS_INDEX)%POLYNOMIAL_COEFF(1:7,B)
         ENDDO
      ENDIF
   ENDIF
ENDIF

IF (POLY=='null') THEN
   TD=>THERMO_DATA(SPEC_INDEX)
   POLY = TD%POLY
   BANDS = TD%BANDS
   TB = TD%T
   A = TD%A
   BC = TD%B
ENDIF

TE = REAL(I_TMP,EB)

SELECT CASE (POLY)
   CASE ('NASA9')
      TE = MIN(MAXVAL(TB),MAX(TB(1),TE))
      DO B=1,BANDS
         IF (TE<=TB(B+1)) EXIT
      ENDDO
      CP = A(1,B)/TE**2 + A(2,B)/TE + A(3,B) + A(4,B)*TE + A(5,B)*TE**2 + A(6,B)*TE**3 + A(7,B)*TE**4
      CP = CP * RCON
      H =  -A(1,B)/TE + A(2,B)*LOG(TE) + A(3,B)*TE + 0.5_EB*A(4,B)*TE**2 + ONTH*A(5,B)*TE**3 + &
            0.25_EB*A(6,B)*TE**4 + 0.2_EB*A(7,B)*TE**5 + BC(1,B)
      S =  -0.5_EB*A(1,B)/TE**2 - A(2,B)/TE + A(3,B)*LOG(TE) + A(4,B)*TE + 0.5_EB*A(5,B)*TE**2 + &
            ONTH*A(6,B)*TE**3 + 0.25_EB*A(7,B)*TE**4 + BC(2,B)
      G_F = (H - TE * S)*R0*1.E-6_EB !R0 kmol to mol and G_F J to kJ
   CASE ('NASA7')
      TE = MIN(MAXVAL(TB),MAX(TB(1),TE))
      DO B=1,BANDS
         IF (TE<=TB(B+1)) EXIT
      ENDDO
      CP = A(1,B) + A(2,B)*TE + A(3,B)*TE**2 + A(4,B)*TE**3 + A(5,B)*TE**4
      CP = CP * RCON
      H =  A(1,B)*TE + 0.5_EB*A(2,B)*TE**2 + ONTH*A(3,B)*TE**3 + 0.25_EB*A(4,B)*TE**4 + &
            0.2_EB*A(5,B)*TE**5 + BC(1,B)
      S =  A(1,B)*LOG(TE) + A(2,B)*TE + 0.5_EB*A(3,B)*TE**2 + ONTH*A(4,B)*TE**3 + 0.25_EB*A(5,B)*TE**4 + BC(2,B)
      G_F = (H - TE * S)*R0*1.E-6_EB !R0 kmol to mol and G_F J to kJ
   CASE ('MOSKVA')
      TE = MIN(TB(2),MAX(TB(1),TE))
      CP= (A(1,1) + A(2,1)*TE**0.25_EB + A(3,1)*TE + A(4,1)*LOG(TE))*1000._EB
   CASE ('WEBBOOK')
      TE = MIN(TB(2),MAX(TB(1),TE))
      CP = A(1,1) + A(2,1)*TE + A(3,1)*TE**2 + A(4,1) * TE**3 + A(5,1)*TE**4
END SELECT

END SUBROUTINE THERMO_TABLE_GAS


SUBROUTINE THERMO_TABLE_LIQUID(I_TMP,CP,H_V,T_REF,T_MELT,T_BOIL,SPEC_INDEX,FUEL,DENSITY,MU,K,BETA)
!CP data in this subroutine is taken from 4th Edition of the NIST-JANAF Thermochemical Tables
!The tabulated data in the tables have been curve fit
!For each species CP is first computed in kJ/mol/K and then converted to J/kg/K
INTEGER, INTENT(IN) :: I_TMP,SPEC_INDEX
REAL(EB), INTENT(INOUT) :: CP,H_V,T_REF,T_MELT,T_BOIL,DENSITY,MU,K,BETA
REAL(EB) :: TE
INTEGER :: B
LOGICAL,INTENT(OUT) :: FUEL
TYPE (THERMO_DATA_TYPE), POINTER :: TD

!Default to water properteis

IF (SPEC_INDEX < 0) THEN
   FUEL = .FALSE.
   BETA = 0.000889_EB !1/K (H2O)
   MU = 0.00089_EB !Ns/m^2 (H2O)
   K = 0.6 !W/m/K (H2O)
   CP = -1._EB
   H_V = -1._EB
   T_REF = -1._EB
   DENSITY=-1._EB
   T_MELT = -1._EB
   T_BOIL = -1._EB
   RETURN
ENDIF

TD => THERMO_DATA(SPEC_INDEX)

IF(TD%LIQUID) THEN
   TE = MIN(MAXVAL(TD%T_L),MAX(TD%T_L(1),REAL(I_TMP,EB)))
   DO B=1,TD%BANDS
      IF (TE<=TD%T_L(B+1)) EXIT
   ENDDO
   TE      = TE * TD%T_UNIT
   CP      = TD%A_L(1,B)/TE**2 + TD%A_L(2,B)/TE + TD%A_L(3,B) + TD%A_L(4,B)*TE + TD%A_L(5,B)*TE**2 + &
               TD%A_L(6,B)*TE**3 + TD%A_L(7,B)*TE**4
   CP      = CP * TD%CP_UNIT
   H_V     = TD%H_V
   T_REF   = TD%T_REF
   T_MELT  = TD%T_MELT
   T_BOIL  = TD%T_BOIL
   DENSITY = TD%DENSITY
   FUEL    = TD%FUEL
   BETA    = TD%BETA
   MU      = TD%MU
   K       = TD%K
ELSE
   FUEL = .FALSE.
   BETA = 0.000889_EB !1/K (H2O)
   MU = 0.00089_EB !Ns/m^2 (H2O)
   K = 0.6 !W/m/K (H2O)
   CP = -1._EB
   H_V = -1._EB
   T_REF = -1._EB
   DENSITY=-1._EB
   T_MELT = -1._EB
   T_BOIL = -1._EB
ENDIF

END SUBROUTINE THERMO_TABLE_LIQUID


SUBROUTINE GAS_PROPS(GAS_INDEX,SIGMA,EPSOK,PR_GAS,MW,FORMULA,LISTED,ATOM_COUNTS,H_F,RADCAL_NAME)

USE GLOBAL_CONSTANTS, ONLY: PR
REAL(EB), INTENT(INOUT) :: SIGMA,EPSOK,MW,H_F,PR_GAS
INTEGER, INTENT (IN) :: GAS_INDEX
LOGICAL, INTENT(OUT) :: LISTED
CHARACTER(LABEL_LENGTH), INTENT(INOUT) :: RADCAL_NAME
CHARACTER(FORMULA_LENGTH), INTENT(INOUT) :: FORMULA
REAL(EB) :: SIGMAIN,EPSOKIN,MWIN,ATOM_COUNTS(118),H_FIN,PR_GASIN
CHARACTER(FORMULA_LENGTH) :: FORMULAIN
TYPE(THERMO_DATA_TYPE), POINTER :: TD

SIGMAIN = SIGMA
EPSOKIN = EPSOK
H_FIN = H_F
MWIN = MW
MW = -1._EB
PR_GASIN = PR_GAS
PR_GAS = PR
FORMULAIN = FORMULA
FORMULA = 'null'

LISTED  = .TRUE.
ATOM_COUNTS = 0._EB

IF (GAS_INDEX==-1) THEN
   ! NITROGEN VALUES
   SIGMA = 3.798_EB
   EPSOK = 71.4_EB
   H_F = -1.E30_EB
   MW = 28.01340_EB
   PR_GAS = 0.71_EB ! JPCRD 19(5)
   LISTED = .FALSE.
ELSE
   TD => THERMO_DATA(GAS_INDEX)
   SIGMA   = TD%SIGMA
   EPSOK   = TD%EPSOK
   FORMULA = TD%FORMULA
   H_F     = TD%H_F
   PR_GAS  = TD%PR
   IF (RADCAL_NAME=='null') RADCAL_NAME = TD%RADCAL_ID
ENDIF

H_F = H_F*1.E3  !kJ/mol -> J/mol

IF (SIGMAIN>0._EB) SIGMA = SIGMAIN
IF (EPSOKIN>0._EB) EPSOK = EPSOKIN
IF (PR_GASIN>0._EB) PR_GAS = PR_GASIN
IF (TRIM(FORMULAIN)/='null') FORMULA = FORMULAIN
!Default Y_O2_INFTY and Y_CO2_INFTY
IF (TRIM(FORMULA)=='Air') THEN
   MW = 28.0134_EB*0.790064146_EB + 31.9988_EB*0.209545743_EB + 44.0095_EB*0.000390111_EB
ELSEIF (TRIM(FORMULA)/='null') THEN
   CALL GET_FORMULA_WEIGHT(FORMULA,MW,ATOM_COUNTS)
ENDIF
IF (MWIN   >0._EB) MW = MWIN
IF (H_FIN > -1.E21_EB) H_F = H_FIN

END SUBROUTINE GAS_PROPS


SUBROUTINE FED_PROPS(GAS_NAME,FLD_IRR,FIC_IRR)
! Lethal and incapacitating concentrations
! D.A. Purser, SFPE Handbook, 4th Ed.

REAL(EB),INTENT(INOUT):: FLD_IRR,FIC_IRR
REAL(EB) ::FLD_IRR_IN,FIC_IRR_IN
CHARACTER(LABEL_LENGTH) GAS_NAME

FLD_IRR_IN = FLD_IRR
FIC_IRR_IN = FIC_IRR

SELECT CASE(GAS_NAME)
   CASE('HYDROGEN BROMIDE')
      FLD_IRR=0.114000_EB
      FIC_IRR=0.000900_EB
   CASE('HYDROGEN CHLORIDE')
      FLD_IRR=0.114000_EB
      FIC_IRR=0.000900_EB
   CASE('HYDROGEN FLUORIDE')
      FLD_IRR=0.087000_EB
      FIC_IRR=0.000900_EB
   CASE('SULFUR DIOXIDE')
      FLD_IRR=0.012000_EB
      FIC_IRR=0.000120_EB
   CASE('NITROGEN DIOXIDE')
      FLD_IRR=0.001900_EB
      FIC_IRR=0.000350_EB
   CASE('ACROLEIN')
      FLD_IRR=0.004500_EB
      FIC_IRR=0.000020_EB
   CASE('FORMALDEHYDE')
      FLD_IRR=0.022500_EB
      FIC_IRR=0.000030_EB
   CASE DEFAULT
      FLD_IRR=0._EB
      FIC_IRR=0._EB
END SELECT

IF(FLD_IRR_IN > 0._EB) FLD_IRR = FLD_IRR_IN
IF(FIC_IRR_IN > 0._EB) FIC_IRR = FIC_IRR_IN

END SUBROUTINE FED_PROPS

SUBROUTINE CALC_GAS_PROPS(J,N,D_TMP,MU_TMP,K_TMP,CP_TMP,G_F_TMP)
USE TYPES, ONLY:SPECIES_TYPE,SPECIES,SPECIES_MIXTURE_TYPE,SPECIES_MIXTURE
INTEGER,INTENT(IN) :: J,N
INTEGER :: I(1)
REAL(EB), INTENT(OUT) :: D_TMP,MU_TMP,K_TMP,CP_TMP,G_F_TMP
REAL(EB) :: SIGMA2,EPSIJ,AMW,TSTAR,OMEGA,TMP
TYPE(SPECIES_TYPE),POINTER :: SS,SS0

SS=>SPECIES(N)

TMP = REAL(J,EB)
IF (SS%D_USER>=0._EB) THEN
   D_TMP = SS%D_USER
ELSE
   I = MAXLOC(SPECIES_MIXTURE(1)%VOLUME_FRACTION)
   SS0=>SPECIES(I(1))
   SIGMA2 = (0.5_EB*(SS%SIG+SS0%SIG))**2
   EPSIJ  = SQRT(SS%EPSK*SS0%EPSK)
   AMW    = SQRT( (SS%MW+SS0%MW)/(2._EB*SS%MW*SS0%MW) )
   TSTAR = TMP/EPSIJ
   OMEGA = 1.06036_EB*TSTAR**(-0.15610_EB) + 0.19300_EB*EXP(-0.47635_EB*TSTAR) + 1.03587_EB*EXP(-1.52996_EB*TSTAR) &
         + 1.76474_EB*EXP(-3.89411_EB*TSTAR)
   D_TMP = 0.00266E-4_EB*AMW*TMP*SQRT(TMP)/(SIGMA2*OMEGA)
ENDIF

IF (SS%MU_USER>=0._EB) THEN
   MU_TMP = SS%MU_USER / SQRT(SS%MW)
ELSE
   SIGMA2 = SS%SIG**2
   TSTAR = TMP/SS%EPSK
   OMEGA = 1.16145_EB*TSTAR**(-0.14874_EB) +  0.52487_EB*EXP(-0.77320_EB*TSTAR) + 2.16178_EB*EXP(-2.43787_EB*TSTAR)
   MU_TMP = 26.69E-7_EB*SQRT(TMP)/(SIGMA2*OMEGA) ! SQRT(SS%MW) was in numerator Eq. 4-29
ENDIF

IF (SS%SPECIFIC_HEAT > 0._EB) THEN
   CP_TMP = SS%SPECIFIC_HEAT
ELSE
   CALL THERMO_TABLE_GAS(J,CP_TMP,SS%PROP_INDEX,N,SS%RCON,G_F_TMP)
ENDIF

IF (SS%K_USER>=0._EB) THEN
   K_TMP = SS%K_USER / SQRT(SS%MW)
ELSE
   K_TMP = MU_TMP*CP_TMP/SS%PR_USER !MU_TMP divided by SQRT(SS%MW)
ENDIF

END SUBROUTINE CALC_GAS_PROPS


SUBROUTINE LOOKUP_CHI_R(FUEL,CHI_R)

! For a given FUEL, send back the radiative fraction. Source: 5th SFPE Handbook.

CHARACTER(LABEL_LENGTH),INTENT(IN) :: FUEL
REAL(EB), INTENT(OUT) :: CHI_R

SELECT CASE(FUEL)
   CASE('ACETONE')     ; CHI_R = 0.27_EB  ! Table A.39, Appendix 3
   CASE('ACETYLENE')   ; CHI_R = 0.49_EB  ! Table A.39, Appendix 3
   CASE('BENZENE')     ; CHI_R = 0.60_EB  ! Table A.39, Appendix 3
   CASE('BUTANE')      ; CHI_R = 0.31_EB  ! Table A.39, Appendix 3
   CASE('DODECANE')    ; CHI_R = 0.40_EB  ! Table 66.14, Beyler chapter
   CASE('ETHANE')      ; CHI_R = 0.25_EB  ! Table A.39, Appendix 3
   CASE('ETHANOL')     ; CHI_R = 0.25_EB  ! Table A.39, Appendix 3
   CASE('ETHYLENE')    ; CHI_R = 0.34_EB  ! Table A.39, Appendix 3
   CASE('HYDROGEN')    ; CHI_R = 0.20_EB  ! Table 66.14, Beyler chapter
   CASE('ISOOCTANE')   ; CHI_R = 0.40_EB  ! Table 66.14, Beyler chapter
   CASE('ISOPROPANOL') ; CHI_R = 0.29_EB  ! Table A.39, Appendix 3
   CASE('METHANE')     ; CHI_R = 0.20_EB  ! Table 66.14, Beyler chapter
   CASE('METHANOL')    ; CHI_R = 0.21_EB  ! Buch et al., C&F 108: 118-126 (1997)
   CASE('N-DECANE')    ; CHI_R = 0.40_EB  ! Table 66.14, Beyler chapter
   CASE('N-HEPTANE')   ; CHI_R = 0.40_EB  ! Table 66.14, Beyler chapter
   CASE('N-HEXANE')    ; CHI_R = 0.40_EB  ! Table 66.14, Beyler chapter
   CASE('N-PENTANE')   ; CHI_R = 0.40_EB  ! Table 66.14, Beyler chapter
   CASE('N-OCTANE')    ; CHI_R = 0.40_EB  ! Table 66.14, Beyler chapter
   CASE('PROPANE')     ; CHI_R = 0.29_EB  ! Table A.39, Appendix 3
   CASE('PROPANOL')    ; CHI_R = 0.29_EB  ! Table A.39, Appendix 3
   CASE('PROPYLENE')   ; CHI_R = 0.37_EB  ! Table A.39, Appendix 3
   CASE('TOLUENE')     ; CHI_R = 0.40_EB  ! Table 66.14, Beyler chapter
   CASE DEFAULT        ; CHI_R = 0.35_EB
END SELECT

END SUBROUTINE LOOKUP_CHI_R


SUBROUTINE LOOKUP_CRITICAL_FLAME_TEMPERATURE(FUEL,CRITICAL_FLAME_TEMPERATURE)

! For a given FUEL, send back the Critical Flame Temperature in degrees C

CHARACTER(LABEL_LENGTH),INTENT(IN) :: FUEL
REAL(EB), INTENT(OUT) :: CRITICAL_FLAME_TEMPERATURE

SELECT CASE(FUEL)
   CASE('ACETONE')     ; CRITICAL_FLAME_TEMPERATURE = 1457._EB
   CASE('ACETYLENE')   ; CRITICAL_FLAME_TEMPERATURE = 1267._EB
   CASE('BENZENE')     ; CRITICAL_FLAME_TEMPERATURE = 1537._EB
   CASE('BUTANE')      ; CRITICAL_FLAME_TEMPERATURE = 1557._EB
   CASE('ETHANE')      ; CRITICAL_FLAME_TEMPERATURE = 1357._EB
   CASE('ETHANOL')     ; CRITICAL_FLAME_TEMPERATURE = 1397._EB
   CASE('ETHYLENE')    ; CRITICAL_FLAME_TEMPERATURE = 1337._EB
   CASE('HYDROGEN')    ; CRITICAL_FLAME_TEMPERATURE =  807._EB
   CASE('ISOPROPANOL') ; CRITICAL_FLAME_TEMPERATURE = 1427._EB
   CASE('METHANE')     ; CRITICAL_FLAME_TEMPERATURE = 1507._EB
   CASE('METHANOL')    ; CRITICAL_FLAME_TEMPERATURE = 1257._EB
   CASE('N-DECANE')    ; CRITICAL_FLAME_TEMPERATURE = 1507._EB
   CASE('N-HEPTANE')   ; CRITICAL_FLAME_TEMPERATURE = 1497._EB
   CASE('N-HEXANE')    ; CRITICAL_FLAME_TEMPERATURE = 1497._EB
   CASE('N-PENTANE')   ; CRITICAL_FLAME_TEMPERATURE = 1487._EB
   CASE('N-OCTANE')    ; CRITICAL_FLAME_TEMPERATURE = 1507._EB
   CASE('PROPANE')     ; CRITICAL_FLAME_TEMPERATURE = 1447._EB
   CASE DEFAULT        ; CRITICAL_FLAME_TEMPERATURE = 1427._EB
END SELECT

END SUBROUTINE LOOKUP_CRITICAL_FLAME_TEMPERATURE


SUBROUTINE LOOKUP_LOWER_OXYGEN_LIMIT(FUEL,LOWER_OXYGEN_LIMIT)

! For a given FUEL, return the Lower Oxygen Limit as a volume fraction

CHARACTER(LABEL_LENGTH),INTENT(IN) :: FUEL
REAL(EB), INTENT(OUT) :: LOWER_OXYGEN_LIMIT

SELECT CASE(FUEL)
   CASE('ACETONE')     ; LOWER_OXYGEN_LIMIT = 0.129_EB
   CASE('ACETYLENE')   ; LOWER_OXYGEN_LIMIT = 0.085_EB
   CASE('BENZENE')     ; LOWER_OXYGEN_LIMIT = 0.133_EB
   CASE('BUTANE')      ; LOWER_OXYGEN_LIMIT = 0.134_EB
   CASE('ETHANE')      ; LOWER_OXYGEN_LIMIT = 0.118_EB
   CASE('ETHANOL')     ; LOWER_OXYGEN_LIMIT = 0.126_EB
   CASE('ETHYLENE')    ; LOWER_OXYGEN_LIMIT = 0.105_EB
   CASE('HYDROGEN')    ; LOWER_OXYGEN_LIMIT = 0.054_EB
   CASE('ISOPROPANOL') ; LOWER_OXYGEN_LIMIT = 0.128_EB
   CASE('METHANE')     ; LOWER_OXYGEN_LIMIT = 0.139_EB
   CASE('METHANOL')    ; LOWER_OXYGEN_LIMIT = 0.111_EB
   CASE('N-DECANE')    ; LOWER_OXYGEN_LIMIT = 0.135_EB
   CASE('N-HEPTANE')   ; LOWER_OXYGEN_LIMIT = 0.134_EB
   CASE('N-HEXANE')    ; LOWER_OXYGEN_LIMIT = 0.134_EB
   CASE('N-PENTANE')   ; LOWER_OXYGEN_LIMIT = 0.134_EB
   CASE('N-OCTANE')    ; LOWER_OXYGEN_LIMIT = 0.134_EB
   CASE('PROPANE')     ; LOWER_OXYGEN_LIMIT = 0.127_EB
   CASE DEFAULT        ; LOWER_OXYGEN_LIMIT = 0.135_EB
END SELECT

END SUBROUTINE LOOKUP_LOWER_OXYGEN_LIMIT


SUBROUTINE CALC_MIX_PROPS(J,D_TMP,MU_TMP,K_TMP,CP_TMP,EPSK,SIG,D_USER,MU_USER,K_USER,MW,CP_USER,PR_USER)
USE TYPES, ONLY:SPECIES_TYPE,SPECIES,SPECIES_MIXTURE_TYPE,SPECIES_MIXTURE
USE GLOBAL_CONSTANTS, ONLY: PR
INTEGER,INTENT(IN) :: J
INTEGER :: I(1)
REAL(EB), INTENT(IN) :: EPSK,SIG,D_USER,MU_USER,K_USER,MW,CP_USER,PR_USER
REAL(EB), INTENT(INOUT) :: D_TMP,MU_TMP,K_TMP,CP_TMP
REAL(EB) :: SIGMA2,EPSIJ,AMW,TSTAR,OMEGA,TMP,PR_TMP
TYPE(SPECIES_TYPE),POINTER :: SS0

TMP = REAL(J,EB)
IF (SIG > 0._EB .AND. EPSK > 0._EB) THEN
   I = MAXLOC(SPECIES_MIXTURE(1)%VOLUME_FRACTION)
   SS0=>SPECIES(I(1))
   SIGMA2 = (0.5_EB*(SIG+SS0%SIG))**2
   EPSIJ  = SQRT(EPSK*SS0%EPSK)
   AMW    = SQRT( (MW+SS0%MW)/(2._EB*MW*SS0%MW) )
   TSTAR = TMP/EPSIJ
   OMEGA = 1.06036_EB*TSTAR**(-0.15610_EB) + 0.19300_EB*EXP(-0.47635_EB*TSTAR) + 1.03587_EB*EXP(-1.52996_EB*TSTAR) &
         + 1.76474_EB*EXP(-3.89411_EB*TSTAR)
   D_TMP = 0.00266E-4_EB*AMW*TMP*SQRT(TMP)/(SIGMA2*OMEGA)
   SIGMA2 = SIG**2
   TSTAR = TMP/EPSK
   OMEGA = 1.16145_EB*TSTAR**(-0.14874_EB) +  0.52487_EB*EXP(-0.77320_EB*TSTAR) + 2.16178_EB*EXP(-2.43787_EB*TSTAR)
   MU_TMP = 26.69E-7_EB*SQRT(TMP)/(SIGMA2*OMEGA)
ENDIF
IF (D_USER>=0._EB) D_TMP = D_USER
IF (MU_USER>=0._EB) MU_TMP = MU_USER / SQRT(MW)
IF (CP_USER > 0._EB) CP_TMP = CP_USER
PR_TMP = PR
IF (PR_USER > 0._EB) PR_TMP = PR_USER
IF (SIG > 0._EB .AND. EPSK > 0._EB) K_TMP = MU_TMP*CP_TMP/PR_TMP
IF (K_USER>=0._EB) K_TMP = K_USER/SQRT(MW)

END SUBROUTINE CALC_MIX_PROPS

SUBROUTINE MAKE_PERIODIC_TABLE

ELEMENT(1)%ABBREVIATION='H'; ELEMENT(1)%NAME='HYDROGEN'; ELEMENT(1)%MASS=1.00794_EB
ELEMENT(2)%ABBREVIATION='He'; ELEMENT(2)%NAME='HELIUM'; ELEMENT(2)%MASS=4.002602_EB
ELEMENT(3)%ABBREVIATION='Li'; ELEMENT(3)%NAME='LITHIUM'; ELEMENT(3)%MASS=6.941_EB
ELEMENT(4)%ABBREVIATION='Be'; ELEMENT(4)%NAME='BERYLLIUM'; ELEMENT(4)%MASS=9.012182_EB
ELEMENT(5)%ABBREVIATION='B'; ELEMENT(5)%NAME='BORON'; ELEMENT(5)%MASS=10.811_EB
ELEMENT(6)%ABBREVIATION='C'; ELEMENT(6)%NAME='CARBON'; ELEMENT(6)%MASS=12.0107_EB
ELEMENT(7)%ABBREVIATION='N'; ELEMENT(7)%NAME='NITROGEN'; ELEMENT(7)%MASS=14.0067_EB
ELEMENT(8)%ABBREVIATION='O'; ELEMENT(8)%NAME='OXYGEN'; ELEMENT(8)%MASS=15.9994_EB
ELEMENT(9)%ABBREVIATION='F'; ELEMENT(9)%NAME='FLUORINE'; ELEMENT(9)%MASS=18.9984032_EB
ELEMENT(10)%ABBREVIATION='Ne'; ELEMENT(10)%NAME='NEON'; ELEMENT(10)%MASS=20.1797_EB
ELEMENT(11)%ABBREVIATION='Na'; ELEMENT(11)%NAME='SODIUM'; ELEMENT(11)%MASS=22.98976928_EB
ELEMENT(12)%ABBREVIATION='Mg'; ELEMENT(12)%NAME='MAGNESIUM'; ELEMENT(12)%MASS=24.305_EB
ELEMENT(13)%ABBREVIATION='Al'; ELEMENT(13)%NAME='ALUMINIUM'; ELEMENT(13)%MASS=26.9815386_EB
ELEMENT(14)%ABBREVIATION='Si'; ELEMENT(14)%NAME='SILICON'; ELEMENT(14)%MASS=28.0855_EB
ELEMENT(15)%ABBREVIATION='P'; ELEMENT(15)%NAME='PHOSPHORUS'; ELEMENT(15)%MASS=30.973762_EB
ELEMENT(16)%ABBREVIATION='S'; ELEMENT(16)%NAME='SULFUR'; ELEMENT(16)%MASS=32.065_EB
ELEMENT(17)%ABBREVIATION='Cl'; ELEMENT(17)%NAME='CHLORINE'; ELEMENT(17)%MASS=35.453_EB
ELEMENT(18)%ABBREVIATION='Ar'; ELEMENT(18)%NAME='ARGON'; ELEMENT(18)%MASS=39.948_EB
ELEMENT(19)%ABBREVIATION='K'; ELEMENT(19)%NAME='POTASSIUM'; ELEMENT(19)%MASS=39.0983_EB
ELEMENT(20)%ABBREVIATION='Ca'; ELEMENT(20)%NAME='CALCIUM'; ELEMENT(20)%MASS=40.078_EB
ELEMENT(21)%ABBREVIATION='Sc'; ELEMENT(21)%NAME='SCANDIUM'; ELEMENT(21)%MASS=44.955912_EB
ELEMENT(22)%ABBREVIATION='Ti'; ELEMENT(22)%NAME='TITANIUM'; ELEMENT(22)%MASS=47.867_EB
ELEMENT(23)%ABBREVIATION='V'; ELEMENT(23)%NAME='VANADIUM'; ELEMENT(23)%MASS=50.9415_EB
ELEMENT(24)%ABBREVIATION='Cr'; ELEMENT(24)%NAME='CHROMIUM'; ELEMENT(24)%MASS=51.9961_EB
ELEMENT(25)%ABBREVIATION='Mn'; ELEMENT(25)%NAME='MANGANESE'; ELEMENT(25)%MASS=54.938045_EB
ELEMENT(26)%ABBREVIATION='Fe'; ELEMENT(26)%NAME='IRON'; ELEMENT(26)%MASS=55.845_EB
ELEMENT(27)%ABBREVIATION='Co'; ELEMENT(27)%NAME='COBALT'; ELEMENT(27)%MASS=58.933195_EB
ELEMENT(28)%ABBREVIATION='Ni'; ELEMENT(28)%NAME='NICKEL'; ELEMENT(28)%MASS=58.6934_EB
ELEMENT(29)%ABBREVIATION='Cu'; ELEMENT(29)%NAME='COPPER'; ELEMENT(29)%MASS=63.546_EB
ELEMENT(30)%ABBREVIATION='Zn'; ELEMENT(30)%NAME='ZINC'; ELEMENT(30)%MASS=65.38_EB
ELEMENT(31)%ABBREVIATION='Ga'; ELEMENT(31)%NAME='GALLIUM'; ELEMENT(31)%MASS=69.723_EB
ELEMENT(32)%ABBREVIATION='Ge'; ELEMENT(32)%NAME='GERMANIUM'; ELEMENT(32)%MASS=72.64_EB
ELEMENT(33)%ABBREVIATION='As'; ELEMENT(33)%NAME='ARSENIC'; ELEMENT(33)%MASS=74.9216_EB
ELEMENT(34)%ABBREVIATION='Se'; ELEMENT(34)%NAME='SELENIUM'; ELEMENT(34)%MASS=78.96_EB
ELEMENT(35)%ABBREVIATION='Br'; ELEMENT(35)%NAME='BROMINE'; ELEMENT(35)%MASS=79.904_EB
ELEMENT(36)%ABBREVIATION='Kr'; ELEMENT(36)%NAME='KRYPTON'; ELEMENT(36)%MASS=83.798_EB
ELEMENT(37)%ABBREVIATION='Rb'; ELEMENT(37)%NAME='RUBIDIUM'; ELEMENT(37)%MASS=85.4678_EB
ELEMENT(38)%ABBREVIATION='Sr'; ELEMENT(38)%NAME='STRONTIUM'; ELEMENT(38)%MASS=87.62_EB
ELEMENT(39)%ABBREVIATION='Y'; ELEMENT(39)%NAME='YTTRIUM'; ELEMENT(39)%MASS=88.90585_EB
ELEMENT(40)%ABBREVIATION='Zr'; ELEMENT(40)%NAME='ZIRCONIUM'; ELEMENT(40)%MASS=91.224_EB
ELEMENT(41)%ABBREVIATION='Nb'; ELEMENT(41)%NAME='NIOBIUM'; ELEMENT(41)%MASS=92.90638_EB
ELEMENT(42)%ABBREVIATION='Mo'; ELEMENT(42)%NAME='MOLYBDENUM'; ELEMENT(42)%MASS=95.96_EB
ELEMENT(43)%ABBREVIATION='Tc'; ELEMENT(43)%NAME='TECHNETIUM'; ELEMENT(43)%MASS=98_EB
ELEMENT(44)%ABBREVIATION='Ru'; ELEMENT(44)%NAME='RUTHENIUM'; ELEMENT(44)%MASS=101.07_EB
ELEMENT(45)%ABBREVIATION='Rh'; ELEMENT(45)%NAME='RHODIUM'; ELEMENT(45)%MASS=102.9055_EB
ELEMENT(46)%ABBREVIATION='Pd'; ELEMENT(46)%NAME='PALLADIUM'; ELEMENT(46)%MASS=106.42_EB
ELEMENT(47)%ABBREVIATION='Ag'; ELEMENT(47)%NAME='SILVER'; ELEMENT(47)%MASS=107.8682_EB
ELEMENT(48)%ABBREVIATION='Cd'; ELEMENT(48)%NAME='CADMIUM'; ELEMENT(48)%MASS=112.411_EB
ELEMENT(49)%ABBREVIATION='In'; ELEMENT(49)%NAME='INDIUM'; ELEMENT(49)%MASS=114.818_EB
ELEMENT(50)%ABBREVIATION='Sn'; ELEMENT(50)%NAME='TIN'; ELEMENT(50)%MASS=118.71_EB
ELEMENT(51)%ABBREVIATION='Sb'; ELEMENT(51)%NAME='ANTIMONY'; ELEMENT(51)%MASS=121.76_EB
ELEMENT(52)%ABBREVIATION='Te'; ELEMENT(52)%NAME='TELLURIUM'; ELEMENT(52)%MASS=127.6_EB
ELEMENT(53)%ABBREVIATION='I'; ELEMENT(53)%NAME='IODINE'; ELEMENT(53)%MASS=126.90447_EB
ELEMENT(54)%ABBREVIATION='Xe'; ELEMENT(54)%NAME='XENON'; ELEMENT(54)%MASS=131.293_EB
ELEMENT(55)%ABBREVIATION='Cs'; ELEMENT(55)%NAME='CAESIUM'; ELEMENT(55)%MASS=132.9054519_EB
ELEMENT(56)%ABBREVIATION='Ba'; ELEMENT(56)%NAME='BARIUM'; ELEMENT(56)%MASS=137.327_EB
ELEMENT(57)%ABBREVIATION='La'; ELEMENT(57)%NAME='LANTHANUM'; ELEMENT(57)%MASS=138.90547_EB
ELEMENT(58)%ABBREVIATION='Ce'; ELEMENT(58)%NAME='CERIUM'; ELEMENT(58)%MASS=140.116_EB
ELEMENT(59)%ABBREVIATION='Pr'; ELEMENT(59)%NAME='PRASEODYMIUM'; ELEMENT(59)%MASS=140.90765_EB
ELEMENT(60)%ABBREVIATION='Nd'; ELEMENT(60)%NAME='NEODYMIUM'; ELEMENT(60)%MASS=144.242_EB
ELEMENT(61)%ABBREVIATION='Pm'; ELEMENT(61)%NAME='PROMETHIUM'; ELEMENT(61)%MASS=145_EB
ELEMENT(62)%ABBREVIATION='Sm'; ELEMENT(62)%NAME='SAMARIUM'; ELEMENT(62)%MASS=150.36_EB
ELEMENT(63)%ABBREVIATION='Eu'; ELEMENT(63)%NAME='EUROPIUM'; ELEMENT(63)%MASS=151.964_EB
ELEMENT(64)%ABBREVIATION='Gd'; ELEMENT(64)%NAME='GADOLINIUM'; ELEMENT(64)%MASS=157.25_EB
ELEMENT(65)%ABBREVIATION='Tb'; ELEMENT(65)%NAME='TERBIUM'; ELEMENT(65)%MASS=158.92535_EB
ELEMENT(66)%ABBREVIATION='Dy'; ELEMENT(66)%NAME='DYSPROSIUM'; ELEMENT(66)%MASS=162.5_EB
ELEMENT(67)%ABBREVIATION='Ho'; ELEMENT(67)%NAME='HOLMIUM'; ELEMENT(67)%MASS=164.93032_EB
ELEMENT(68)%ABBREVIATION='Er'; ELEMENT(68)%NAME='ERBIUM'; ELEMENT(68)%MASS=167.259_EB
ELEMENT(69)%ABBREVIATION='Tm'; ELEMENT(69)%NAME='THULIUM'; ELEMENT(69)%MASS=168.93421_EB
ELEMENT(70)%ABBREVIATION='Yb'; ELEMENT(70)%NAME='YTTERBIUM'; ELEMENT(70)%MASS=173.054_EB
ELEMENT(71)%ABBREVIATION='Lu'; ELEMENT(71)%NAME='LUTETIUM'; ELEMENT(71)%MASS=174.9668_EB
ELEMENT(72)%ABBREVIATION='Hf'; ELEMENT(72)%NAME='HAFNIUM'; ELEMENT(72)%MASS=178.49_EB
ELEMENT(73)%ABBREVIATION='Ta'; ELEMENT(73)%NAME='TANTALUM'; ELEMENT(73)%MASS=180.94788_EB
ELEMENT(74)%ABBREVIATION='W'; ELEMENT(74)%NAME='TUNGSTEN'; ELEMENT(74)%MASS=183.84_EB
ELEMENT(75)%ABBREVIATION='Re'; ELEMENT(75)%NAME='RHENIUM'; ELEMENT(75)%MASS=186.207_EB
ELEMENT(76)%ABBREVIATION='Os'; ELEMENT(76)%NAME='OSMIUM'; ELEMENT(76)%MASS=190.23_EB
ELEMENT(77)%ABBREVIATION='Ir'; ELEMENT(77)%NAME='IRIDIUM'; ELEMENT(77)%MASS=192.217_EB
ELEMENT(78)%ABBREVIATION='Pt'; ELEMENT(78)%NAME='PLATINUM'; ELEMENT(78)%MASS=195.084_EB
ELEMENT(79)%ABBREVIATION='Au'; ELEMENT(79)%NAME='GOLD'; ELEMENT(79)%MASS=196.966569_EB
ELEMENT(80)%ABBREVIATION='Hg'; ELEMENT(80)%NAME='MERCURY'; ELEMENT(80)%MASS=200.59_EB
ELEMENT(81)%ABBREVIATION='Tl'; ELEMENT(81)%NAME='THALLIUM'; ELEMENT(81)%MASS=204.3833_EB
ELEMENT(82)%ABBREVIATION='Pb'; ELEMENT(82)%NAME='LEAD'; ELEMENT(82)%MASS=207.2_EB
ELEMENT(83)%ABBREVIATION='Bi'; ELEMENT(83)%NAME='BISMUTH'; ELEMENT(83)%MASS=208.9804_EB
ELEMENT(84)%ABBREVIATION='Po'; ELEMENT(84)%NAME='POLONIUM'; ELEMENT(84)%MASS=210_EB
ELEMENT(85)%ABBREVIATION='At'; ELEMENT(85)%NAME='ASTATINE'; ELEMENT(85)%MASS=210_EB
ELEMENT(86)%ABBREVIATION='Rn'; ELEMENT(86)%NAME='RADON'; ELEMENT(86)%MASS=222_EB
ELEMENT(87)%ABBREVIATION='Fr'; ELEMENT(87)%NAME='FRANCIUM'; ELEMENT(87)%MASS=223_EB
ELEMENT(88)%ABBREVIATION='Ra'; ELEMENT(88)%NAME='RADIUM'; ELEMENT(88)%MASS=226_EB
ELEMENT(89)%ABBREVIATION='Ac'; ELEMENT(89)%NAME='ACTINIUM'; ELEMENT(89)%MASS=227_EB
ELEMENT(90)%ABBREVIATION='Th'; ELEMENT(90)%NAME='THORIUM'; ELEMENT(90)%MASS=232.03806_EB
ELEMENT(91)%ABBREVIATION='Pa'; ELEMENT(91)%NAME='PROTACTINIUM'; ELEMENT(91)%MASS=231.03588_EB
ELEMENT(92)%ABBREVIATION='U'; ELEMENT(92)%NAME='URANIUM'; ELEMENT(92)%MASS=238.02891_EB
ELEMENT(93)%ABBREVIATION='Np'; ELEMENT(93)%NAME='NEPTUNIUM'; ELEMENT(93)%MASS=237_EB
ELEMENT(94)%ABBREVIATION='Pu'; ELEMENT(94)%NAME='PLUTONIUM'; ELEMENT(94)%MASS=244_EB
ELEMENT(95)%ABBREVIATION='Am'; ELEMENT(95)%NAME='AMERICIUM'; ELEMENT(95)%MASS=243_EB
ELEMENT(96)%ABBREVIATION='Cm'; ELEMENT(96)%NAME='CURIUM'; ELEMENT(96)%MASS=247_EB
ELEMENT(97)%ABBREVIATION='Bk'; ELEMENT(97)%NAME='BERKELIUM'; ELEMENT(97)%MASS=247_EB
ELEMENT(98)%ABBREVIATION='Cf'; ELEMENT(98)%NAME='CALIFORNIUM'; ELEMENT(98)%MASS=251_EB
ELEMENT(99)%ABBREVIATION='Es'; ELEMENT(99)%NAME='EINSTEINIUM'; ELEMENT(99)%MASS=252_EB
ELEMENT(100)%ABBREVIATION='Fm'; ELEMENT(100)%NAME='FERMIUM'; ELEMENT(100)%MASS=257_EB
ELEMENT(101)%ABBREVIATION='Md'; ELEMENT(101)%NAME='MENDELEVIUM'; ELEMENT(101)%MASS=258_EB
ELEMENT(102)%ABBREVIATION='No'; ELEMENT(102)%NAME='NOBELIUM'; ELEMENT(102)%MASS=259_EB
ELEMENT(103)%ABBREVIATION='Lr'; ELEMENT(103)%NAME='LAWRENCIUM'; ELEMENT(103)%MASS=262_EB
ELEMENT(104)%ABBREVIATION='Rf'; ELEMENT(104)%NAME='RUTHERFORDIUM'; ELEMENT(104)%MASS=267_EB
ELEMENT(105)%ABBREVIATION='Db'; ELEMENT(105)%NAME='DUBNIUM'; ELEMENT(105)%MASS=270_EB
ELEMENT(106)%ABBREVIATION='Sg'; ELEMENT(106)%NAME='SEABORGIUM'; ELEMENT(106)%MASS=269_EB
ELEMENT(107)%ABBREVIATION='Bh'; ELEMENT(107)%NAME='BOHRIUM'; ELEMENT(107)%MASS=270_EB
ELEMENT(108)%ABBREVIATION='Hs'; ELEMENT(108)%NAME='HASSIUM'; ELEMENT(108)%MASS=270_EB
ELEMENT(109)%ABBREVIATION='Mt'; ELEMENT(109)%NAME='MEITNERIUM'; ELEMENT(109)%MASS=278_EB
ELEMENT(110)%ABBREVIATION='Ds'; ELEMENT(110)%NAME='DARMSTADTIUM'; ELEMENT(110)%MASS=281_EB
ELEMENT(111)%ABBREVIATION='Rg'; ELEMENT(111)%NAME='ROENTGENIUM'; ELEMENT(111)%MASS=281_EB
ELEMENT(112)%ABBREVIATION='Cn'; ELEMENT(112)%NAME='COPERNICIUM'; ELEMENT(112)%MASS=285_EB
ELEMENT(113)%ABBREVIATION='Nh'; ELEMENT(113)%NAME='NIHONIUM'; ELEMENT(113)%MASS=286_EB
ELEMENT(114)%ABBREVIATION='Fl'; ELEMENT(114)%NAME='FLEROVIUM'; ELEMENT(114)%MASS=289_EB
ELEMENT(115)%ABBREVIATION='Mc'; ELEMENT(115)%NAME='MOSCOVIUM'; ELEMENT(115)%MASS=289_EB
ELEMENT(116)%ABBREVIATION='Lv'; ELEMENT(116)%NAME='LIVERMORIUM'; ELEMENT(116)%MASS=293_EB
ELEMENT(117)%ABBREVIATION='Ts'; ELEMENT(117)%NAME='TENNESSINE'; ELEMENT(117)%MASS=293_EB
ELEMENT(118)%ABBREVIATION='Og'; ELEMENT(118)%NAME='OGANESSON'; ELEMENT(118)%MASS=294_EB

END SUBROUTINE MAKE_PERIODIC_TABLE


SUBROUTINE SIMPLE_SPECIES_MW
USE GLOBAL_CONSTANTS,ONLY:MW_N2,MW_O2,MW_CO2,MW_H2O,MW_CO,MW_H2,MW_HCN
REAL(EB)::ATOM_COUNTS(118)
CHARACTER(FORMULA_LENGTH)::FORMULA

FORMULA='N2'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_N2,ATOM_COUNTS)
FORMULA='O2'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_O2,ATOM_COUNTS)
FORMULA='CO2'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_CO2,ATOM_COUNTS)
FORMULA='H2O'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_H2O,ATOM_COUNTS)
FORMULA='CO'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_CO,ATOM_COUNTS)
FORMULA='H2'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_H2,ATOM_COUNTS)
FORMULA='HCN'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_HCN,ATOM_COUNTS)

END SUBROUTINE SIMPLE_SPECIES_MW


RECURSIVE SUBROUTINE GET_FORMULA_WEIGHT(FORMULA,WEIGHT_SUM,ATOM_COUNTS)
USE GLOBAL_CONSTANTS,ONLY:LU_ERR

CHARACTER(3) :: ELEMENT_NAME
CHARACTER(FORMULA_LENGTH), INTENT(IN) :: FORMULA
CHARACTER(FORMULA_LENGTH) :: SUBFORMULA
REAL(EB),INTENT(INOUT)::WEIGHT_SUM
REAL(EB),INTENT(INOUT)::ATOM_COUNTS(118)
REAL(EB)::SUB_WEIGHT,NUM
INTEGER :: I,J,LEN1,ELEMENT_INDEX
REAL(EB):: SUBATOM_COUNTS(118)

ATOM_COUNTS = 0._EB
WEIGHT_SUM = 0._EB
LEN1 = LEN(TRIM(FORMULA))
I=1

DO WHILE (I <= LEN1)
   SUBUNIT_SEARCH: IF(ICHAR(FORMULA(I:I))==IACHAR('(')) THEN
      SUBFORMULA=''
      FIND_RIGHT: DO J=I,LEN1
         IF(ICHAR(FORMULA(J:J))==IACHAR(')')) THEN
            WRITE(SUBFORMULA,'(A)') FORMULA(I+1:J-1)
            EXIT FIND_RIGHT
         ENDIF
      ENDDO FIND_RIGHT
      SUB_WEIGHT=0.
      SUBATOM_COUNTS=0._EB
      CALL GET_FORMULA_WEIGHT(SUBFORMULA,SUB_WEIGHT,SUBATOM_COUNTS)
      J=J+1
      CALL GET_ATOM_MULTIPLIER(FORMULA,J,LEN1,NUM)
      WEIGHT_SUM = WEIGHT_SUM + SUB_WEIGHT*NUM
      ATOM_COUNTS=ATOM_COUNTS+SUBATOM_COUNTS*NUM
      I=J
   ELSE SUBUNIT_SEARCH
      ELEMENT_NAME = '   '
      IF(IACHAR(FORMULA(I+1:I+1))<=IACHAR('z') .AND. IACHAR(FORMULA(I+1:I+1))>=IACHAR('a')) THEN
         IF(IACHAR(FORMULA(I+2:I+2))<=IACHAR('z') .AND. IACHAR(FORMULA(I+2:I+2))>=IACHAR('a')) THEN
            WRITE(ELEMENT_NAME,'(A)') FORMULA(I:I+2)
            I=I+3
         ELSE
            WRITE(ELEMENT_NAME,'(A)') FORMULA(I:I+1)
            I=I+2
         ENDIF
      ELSE
         WRITE(ELEMENT_NAME,'(A)') FORMULA(I:I)
         I=I+1
      ENDIF
      ELEMENT_INDEX = -1
      ELEMENT_SEARCH: DO J=1,118
         IF(TRIM(ELEMENT_NAME)==TRIM(ELEMENT(J)%ABBREVIATION)) THEN
            ELEMENT_INDEX = J
            EXIT ELEMENT_SEARCH
         ENDIF
      ENDDO ELEMENT_SEARCH
      IF (ELEMENT_INDEX<0) THEN
         WRITE(LU_ERR,'(/A,A,A,A,A)') 'ERROR: Element named ',TRIM(ELEMENT_NAME),' in FORUMLA ',TRIM(FORMULA), ' is not found.'
         STOP
      ENDIF
      J=I
      CALL GET_ATOM_MULTIPLIER(FORMULA,J,LEN1,NUM)
      WEIGHT_SUM=WEIGHT_SUM+ELEMENT(ELEMENT_INDEX)%MASS*NUM
      ATOM_COUNTS(ELEMENT_INDEX)=ATOM_COUNTS(ELEMENT_INDEX)+NUM
      I=J
   ENDIF SUBUNIT_SEARCH
ENDDO

END SUBROUTINE GET_FORMULA_WEIGHT


SUBROUTINE GET_ATOM_MULTIPLIER(FORMULA,J,LEN1,NUM)

USE GLOBAL_CONSTANTS, ONLY: LU_ERR
CHARACTER(FORMULA_LENGTH), INTENT(IN) :: FORMULA
INTEGER, INTENT(IN) :: LEN1
INTEGER, INTENT(INOUT) :: J
INTEGER :: I,K,IOS
REAL(EB), INTENT(OUT) :: NUM

NUM=-1._EB
IF (J>LEN1) THEN
   NUM=1._EB
   RETURN
ENDIF
DO I=J,LEN1
   IF((IACHAR(FORMULA(I:I))>=IACHAR('A') .AND. IACHAR(FORMULA(I:I))<=IACHAR('Z')).OR.IACHAR(FORMULA(I:I))==IACHAR('(')) THEN
      IF (I==J) NUM=1.
      EXIT
   ELSEIF((IACHAR(FORMULA(I:I))<IACHAR('0') .OR. IACHAR(FORMULA(I:I))>IACHAR('9')).AND.IACHAR(FORMULA(I:I))/=IACHAR('.')) THEN
      WRITE(LU_ERR,'(/A,I2,A,A)') 'ERROR: Invalid character in atom multiplier at position ',I,' in FORUMLA for ',TRIM(FORMULA)
      STOP
   ELSE
      K=I
   ENDIF
ENDDO

IF (NUM < 0._EB) THEN
   READ(FORMULA(J:K),*,ERR=34,IOSTAT=IOS) NUM
34 IF (IOS>0) THEN
      WRITE(LU_ERR,'(5A,I0)') 'ERROR: Problem parsing ',TRIM(FORMULA(J:K)),' in FORMULA ',TRIM(FORMULA),' IOS=',IOS
      STOP
   ENDIF
ENDIF

J=I

END SUBROUTINE GET_ATOM_MULTIPLIER


SUBROUTINE PARSE_EQUATION(NR)
USE TYPES, ONLY: REACTION_TYPE,REACTION,SPECIES_MIXTURE_TYPE,SPECIES_MIXTURE
USE GLOBAL_CONSTANTS, ONLY: N_TRACKED_SPECIES
USE COMP_FUNCTIONS, ONLY:SHUTDOWN
INTEGER, INTENT(IN) :: NR
CHARACTER(MESSAGE_LENGTH) :: MESSAGE
CHARACTER(FORMULA_LENGTH) :: FORMULA
INTEGER :: I,J,K,LEN1,SPEC_PTR,NS
LOGICAL :: LHS,NAME_FOUND
TYPE(REACTION_TYPE),POINTER::RN=>null()

RN => REACTION(NR)

CALL CHECK_REACTION_CHARACTERS(RN%EQUATION)

LHS=.TRUE.
LEN1 = LEN(TRIM(RN%EQUATION))
I=1
SPEC_PTR=0
DO WHILE (I <= LEN1)
   CALL GET_NU(RN%EQUATION,I,LEN1,RN%NU_READ(SPEC_PTR+1))
   IF (LHS) RN%NU_READ(SPEC_PTR+1) = -RN%NU_READ(SPEC_PTR+1)
   DO J=I,LEN1
      IF(IACHAR(RN%EQUATION(J:J))==IACHAR('+') .OR. IACHAR(RN%EQUATION(J:J))==IACHAR('=')) THEN
         IF(IACHAR(RN%EQUATION(J:J))==IACHAR('=')) LHS=.FALSE.
         K = J - 1
         EXIT
      ENDIF
      K=J
   ENDDO
   FORMULA=''
   WRITE(FORMULA(1:K-I+1),'(A)') RN%EQUATION(I:K)
   NAME_FOUND = .FALSE.
   DO NS=1,N_TRACKED_SPECIES
      IF(TRIM(SPECIES_MIXTURE(NS)%ID)==TRIM(FORMULA) .OR. TRIM(SPECIES_MIXTURE(NS)%FORMULA)==TRIM(FORMULA)) THEN
         IF (NAME_FOUND) THEN
            WRITE(MESSAGE,'(A,I0,A,I0,A)') 'ERROR: Problem with REAC ',NR,'. Species number ',SPEC_PTR+1,&
                                          ' in the EQUATION shares the same FORMULA with another species.'
            CALL SHUTDOWN(MESSAGE) ; RETURN
         ENDIF
         NAME_FOUND=.TRUE.
         RN%SPEC_ID_NU_READ(SPEC_PTR+1) = SPECIES_MIXTURE(NS)%ID
      ENDIF
   ENDDO
   IF (.NOT. NAME_FOUND) THEN
      WRITE(MESSAGE,'(A,I0,A,I0,A)') 'ERROR: Problem with REAC ',NR,'. Species number ',SPEC_PTR+1,&
                                    ' in the EQUATION was not found.'
      CALL SHUTDOWN(MESSAGE) ; RETURN
   ENDIF
   SPEC_PTR = SPEC_PTR + 1
   I = K+2
END DO

END SUBROUTINE PARSE_EQUATION


SUBROUTINE GET_NU(EXPRESSION,J,LEN1,NU)
USE GLOBAL_CONSTANTS, ONLY:LU_ERR,MY_RANK
CHARACTER(255), INTENT(IN)::EXPRESSION
INTEGER,INTENT(IN):: LEN1
INTEGER,INTENT(INOUT)::J
INTEGER::I,K
REAL(EB),INTENT(OUT)::NU

NU=-1._EB
IF (J>LEN1) THEN
   NU=1._EB
   RETURN
ENDIF
DO I=J,LEN1
   IF(IACHAR(EXPRESSION(I:I))==IACHAR('*')) THEN
      IF(I==J) THEN
         IF (MY_RANK==0) THEN
            WRITE(LU_ERR,'(A)') 'Equation:'//TRIM(EXPRESSION)
            WRITE(LU_ERR,'(A,I0)') 'ERROR: No number before * at position ',I
         ENDIF
         STOP
      ELSE
         K=I-1
         EXIT
      ENDIF
   ELSEIF((IACHAR(EXPRESSION(I:I))<IACHAR('0') .OR. IACHAR(EXPRESSION(I:I))>IACHAR('9')).AND.&
           IACHAR(EXPRESSION(I:I))/=IACHAR('.')) THEN
      IF(I==J) THEN
         NU=1._EB
         K=J-1
         EXIT
      ELSEIF(IACHAR(EXPRESSION(I:I))==IACHAR(',') .OR. IACHAR(EXPRESSION(I:I))==IACHAR('-')) THEN
         NU=1._EB
         K=J-1
         EXIT
      ELSE
         IF (MY_RANK==0) THEN
            WRITE(LU_ERR,'(A)') 'Equation:'//TRIM(EXPRESSION)
            WRITE(LU_ERR,'(A,I0,A,A)') 'ERROR: Invalid character in nu at position ',I,': ',EXPRESSION(I:I)
         ENDIF
         STOP
      ENDIF
   ENDIF
ENDDO

IF (NU < 0._EB) READ(EXPRESSION(J:K),*) NU
J=K+1
IF (IACHAR(EXPRESSION(J:J))==IACHAR('*')) J=J+1

END SUBROUTINE GET_NU


SUBROUTINE CHECK_REACTION_CHARACTERS(EXPRESSION)
USE GLOBAL_CONSTANTS, ONLY:LU_ERR,MY_RANK
CHARACTER(255),INTENT(IN)::EXPRESSION
INTEGER :: I,LEN1

LEN1=LEN(TRIM(EXPRESSION))

DO I=1,LEN1
   IF(IACHAR(EXPRESSION(I:I))>=IACHAR('A') .AND. IACHAR(EXPRESSION(I:I))<=IACHAR('Z')) THEN
     CYCLE
   ELSEIF(IACHAR(EXPRESSION(I:I))>=IACHAR('a') .AND. IACHAR(EXPRESSION(I:I))<=IACHAR('z')) THEN
     CYCLE
   ELSEIF(IACHAR(EXPRESSION(I:I))>=IACHAR('0') .AND. IACHAR(EXPRESSION(I:I))<=IACHAR('9')) THEN
     CYCLE
   ELSEIF(IACHAR(EXPRESSION(I:I))==IACHAR('+').OR.IACHAR(EXPRESSION(I:I))==IACHAR('=').OR.IACHAR(EXPRESSION(I:I))==IACHAR('.')) THEN
     CYCLE
   ELSEIF(IACHAR(EXPRESSION(I:I))==IACHAR('(').OR.IACHAR(EXPRESSION(I:I))==IACHAR(')').OR.IACHAR(EXPRESSION(I:I))==IACHAR('*')) THEN
     CYCLE
   ELSEIF(IACHAR(EXPRESSION(I:I))==IACHAR(' ').OR.IACHAR(EXPRESSION(I:I))==IACHAR(',').OR.IACHAR(EXPRESSION(I:I))==IACHAR('-')) THEN
     CYCLE
   ELSE
      IF (MY_RANK==0) THEN
           WRITE(LU_ERR,'(A)') 'Equation:'//TRIM(EXPRESSION)
           WRITE(LU_ERR,'(A,I0,A,A)') 'ERROR: Invalid Character in REAC expression at position ',I,': ',EXPRESSION(I:I)
      ENDIF
      STOP
   ENDIF
ENDDO

END SUBROUTINE CHECK_REACTION_CHARACTERS


!> \brief Write out to both the .err and .out files information on stoichiometry imbalance
!> \param ATOM_COUNT Number of atoms
!> \param NR Reaction number with the problem
!> \param ERR Error tolerance

SUBROUTINE SHUTDOWN_ATOM(ATOM_COUNT,NR,ERR)

USE GLOBAL_CONSTANTS, ONLY: LU_ERR,FN_OUTPUT,LU_OUTPUT,CHID,N_SPECIES,N_TRACKED_SPECIES,MY_RANK
USE TYPES, ONLY:SPECIES,SPECIES_TYPE,SPECIES_MIXTURE_TYPE,SPECIES_MIXTURE,REACTION_TYPE,REACTION
USE COMP_FUNCTIONS, ONLY:SHUTDOWN
INTEGER, INTENT(IN) :: NR
INTEGER :: I,NN,NS
REAL(EB), INTENT(IN) :: ATOM_COUNT(118),ERR
REAL(EB) :: REACTION_BALANCE(118)
LOGICAL :: EX
TYPE (REACTION_TYPE), POINTER :: RN

IF (MY_RANK==0) THEN
   CALL WRITE_ATOM_BALANCE_DIAGNOSTICS(LU_ERR)
   INQUIRE(FILE=FN_OUTPUT,EXIST=EX)
   IF (.NOT.EX) OPEN(LU_OUTPUT,FILE=TRIM(CHID)//'.out',STATUS='REPLACE',FORM='FORMATTED')
   CALL WRITE_ATOM_BALANCE_DIAGNOSTICS(LU_OUTPUT)
ENDIF

CONTAINS

SUBROUTINE WRITE_ATOM_BALANCE_DIAGNOSTICS(LU_OUT)

INTEGER, INTENT(IN) :: LU_OUT

WRITE(LU_OUT,'(/A,I3,A)') 'ERROR: Problem with REAC ',NR,'. Unbalanced stoichiometry.'

! Write out the transformation matrix that converts species mixtures to primitive species

WRITE(LU_OUT,'(//A)') ' Gas Phase Reaction Information'

RN=>REACTION(NR)

IF (RN%ID/='null')  WRITE(LU_OUT,'(/3X,A,A)')   'Reaction ID:  ', TRIM(RN%ID)

WRITE(LU_OUT,'(/3X,A)')     'Stoichiometry'

WRITE(LU_OUT,'(/3X,A)')     'Primitive Species'
WRITE(LU_OUT,'(3X,A)')      'Species ID                                                 Stoich. Coeff.'
DO NN=1,N_SPECIES
   IF (ABS(RN%NU_SPECIES(NN))>=TWO_EPSILON_EB) WRITE(LU_OUT,'(3X,A,1X,F12.6)') SPECIES(NN)%ID,RN%NU_SPECIES(NN)
ENDDO

WRITE(LU_OUT,'(/3X,A)')     'Tracked (Lumped) Species'
WRITE(LU_OUT,'(3X,A)')      'Species ID                                                 Stoich. Coeff.'
DO NN=1,N_TRACKED_SPECIES
   IF (ABS(RN%NU(NN)) < TWO_EPSILON_EB) CYCLE
   IF (ABS(RN%NU(NN)) < 10000._EB) WRITE(LU_OUT,'(3X,A,1X,F12.6)') SPECIES_MIXTURE(NN)%ID,RN%NU(NN)
   IF (ABS(RN%NU(NN)) > 10000._EB) WRITE(LU_OUT,'(3X,A,1X,E12.5)') SPECIES_MIXTURE(NN)%ID,RN%NU(NN)
ENDDO

WRITE(LU_OUT,'(//A)') 'Atom Balance Details'

DO NS=1,N_TRACKED_SPECIES
   WRITE(LU_OUT,'(/3X,A,A)') 'Tracked (Lumped) Species:',SPECIES_MIXTURE(NS)%ID
   WRITE(LU_OUT,'(3X,A)') 'Element  nu*Atom Count'
   REACTION_BALANCE = RN%NU(NS)*SPECIES_MIXTURE(NS)%ATOMS
   DO I=1,118
      IF (ABS(REACTION_BALANCE(I))>TWO_EPSILON_EB) THEN
         WRITE(LU_OUT,'(3X,A,3X,F12.6)') ELEMENT(I)%ABBREVIATION,REACTION_BALANCE(I)
      ENDIF
   ENDDO
ENDDO


WRITE(LU_OUT,'(//A)') 'The following elements are unbalanced:'
WRITE(LU_OUT,'(/A)') 'Element  Atom Error'

DO I=1,118
   IF (ABS(ATOM_COUNT(I)) > ERR) WRITE(LU_OUT,'(2X,A,4X,E10.3)') ELEMENT(I)%ABBREVIATION,ATOM_COUNT(I)
ENDDO

END SUBROUTINE WRITE_ATOM_BALANCE_DIAGNOSTICS

END SUBROUTINE SHUTDOWN_ATOM

!> \brief Find the appropriate ATOM index for the given ELEM_ID

SUBROUTINE GET_ELEM_INDEX(ELEM_ID,ELEM_INDX)
CHARACTER(*), INTENT(IN) :: ELEM_ID
INTEGER, INTENT(OUT) :: ELEM_INDX
INTEGER :: NA

ELEM_INDX = -999

DO NA=1,118
   IF (TRIM(ELEM_ID)==TRIM(ELEMENT(NA)%NAME) .OR. TRIM(ELEM_ID)==TRIM(ELEMENT(NA)%ABBREVIATION)) THEN
      ELEM_INDX = NA
      EXIT
    ENDIF
ENDDO

END SUBROUTINE GET_ELEM_INDEX

END MODULE PROPERTY_DATA
